Home > Web Front-end > JS Tutorial > body text

Use js to get the value of checkbox

小云云
Release: 2018-03-10 15:13:39
Original
2364 people have browsed it

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();
Copy after login

Backend:

String value = request.getParameter("concentratorids");
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!