Home  >  Article  >  Web Front-end  >  Use js to get the value of checkbox

Use js to get the value of checkbox

小云云
小云云Original
2018-03-10 15:13:392369browse

This article mainly shares with you how to use js to obtain the value of the checkbox. I hope it can help you.

显示的内容
显示的内容
显示的内容
显示的内容
....


JS:

function send(){
    var id = document.getElementsByName('test');
    var value = new Array();
    for(var i = 0; i < id.length; i++){
     if(id[i].checked)
     value.push(id[i].value);
    } 
  window.location ='某Action!netWorkingUpdate?concentratorids='+value.toString();

Backend:

String value = request.getParameter("concentratorids");

Then intercept this value

Related recommendations:

##js gets select Detailed explanation of the method of tag value value

jQuery implementation method of obtaining the value value of the selected option

PHP Accumulation of value values ​​of the same key in multi-dimensional arrays function

The above is the detailed content of Use js to get the value of checkbox. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn