安科网
源代码:
点击运行
<!DOCTYPE html> <html> <head> <script> function displayResult() { var x=document.getElementById("red").type; alert(x); } </script> </head> <body> <form> What color do you prefer?<br> <input type="radio" name="colors" id="red">Red<br> <input type="radio" name="colors" id="blue">Blue<br> <input type="radio" name="colors" id="green">Green </form> <button type="button" onclick="displayResult()">Show input type</button> </body> </html>
运行结果
Copyright © 2013 - 2019 Ancii.com All Rights Reserved
京ICP备18063983号-5
京公网安备11010802014868号