Created
November 5, 2015 05:37
-
-
Save pzzrudlf/14daf83f63872f28d80e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var obj=document.getElementsByName('test'); //选择所有name="'test'"的对象,返回数组;取到对象数组后,我们来循环检测它是不是被选中 | |
var s=''; | |
for(var i=0; i<obj.length; i++){ | |
if(obj[i].checked) s+=obj[i].value+','; //如果选中,将value添加到变量s中 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment