fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> <script> function check(){ document.getElementById("red").checked=true } function uncheck(){ document.getElementById("red").checked=false } </script> </head> <body> <form> 你更喜欢哪种颜色?<br> <input type="radio" name="colors" id="red">红色<br> <input type="radio" name="colors" id="blue">蓝色<br> <input type="radio" name="colors" id="green">绿色 </form> <button type="button" onclick="check()">选择 "红色"</button> <button type="button" onclick="uncheck()">不选择 "红色"</button> </body> </html>
运行结果