日期:2014-05-16 浏览次数:20415 次
<script> function cnt() { //var radioCount = document.all.item("pay_class").length; var radioCount = document.baseinfo.pay_class.length; alert("radioCount: " + radioCount); } </script> </head> <body> <form name="baseinfo" id="baseinfo" method="post"> <input type="radio" name="pay_class" id="pay_class" onclick="cnt()">MyRadio<br/> </form> </body>
function cnt() { var radioCount = document.getElementsByName("pay_class").length; alert("radioCount: " + radioCount); }