Javascript 获取radiobuttonlist(单选框)的值

Javascript  获取radiobuttonlist(单选框)的值

 

 function check() {
                var RadioButtonList1 = document.getElementById('<%=RadioButtonList1.ClientID%>');
                var rbs = RadioButtonList1.getElementsByTagName("INPUT");
                for(var i = 0;i<rbs.length;i++) {
                    if (rbs[i].checked) {
                        var text = RadioButtonList1.cells[i].innerText;
                        var value=rbs[i].value;
                        alert(value + text);
                     }
                }

你可能感兴趣的:(JavaScript,function,input)