Problems solved in today's project: JS to determine if the Radio radio button is selected and pop-up value information, initially always get the value of Radio, and later found that there are some problems in the logic, I would like to share the code to leave notes and share the reference to the brothers who encounter such problems :
<script type= "Text/javascript" >//Judging a function above 5 radio that is selectedfunctionjudgeradioclicked () {//get radio button name Collection varRadios = Document.getelementsbyname ("RADIO_TJ"); //traverse the name collection based on the name collection length for(vari=0;i<radios.length;i++) { //Determine which radio button is selected if(radios[i].checked) {//pops the value of the selected radio buttonalert (radios[i].value); } } } </script>
Note://Get single radio button name collection//var radios = Document.getelementsbyname ("RADIO_TJ"); The "RADIO_TJ" in is the Name property of the radio button collection.
Original address: http://blog.csdn.net/songyanjun2011/article/details/7186864
JS determines if the Radio radio button is selected and pops the value information