- <html>
- <head>
- <title>单选按钮(radio)的取消与选中</title>
- </head>
- <body>
- <form>
- <input type="radio" name='radio' value="1" onclick='check(this)'>单选一
- <input type="radio" name='radio' value="2" onclick='check(this)'>单选二
- </form>
- <script language="javascript">
- var tempradio= null;
- function check(checkedRadio)
- {
- if(tempradio== checkedRadio){
- tempradio.checked=false;
- tempradio=null;
- }
- else{
- tempradio= checkedRadio;
- }
- }
- </script>
- </body>
- </html>
radio再次点击后取消
最新推荐文章于 2024-06-18 14:33:23 发布