您好,欢迎访问一九零五行业门户网

html中input框中的radio是否被选中的判断

少写文字, 直接用代码说话:
<html> <body> 男性:<input type="radio" id="male" name="xxx"/> <br /> 女性:<input type="radio" id="female" name="xxx"/> <br /> <button onclick="output()">test</button> <script> function output() { if(document.getelementbyid("male").checked) { alert("1"); } if(document.getelementbyid("female").checked) { alert("2"); } } </script> </body> </html>
搞定。
以上就是html中input框中的radio是否被选中的判断的详细内容。
其它类似信息

推荐信息