zoukankan      html  css  js  c++  java
  • 单选按钮取消选中状态

    方法一:

    <form>
    <input type="radio" name='radio' value="1" onclick='check(this)'>单选一
    <input type="radio" name='radio' value="2" onclick='check(this)'>单选二
    <input type="radio" name='radio2' value="1" onclick='check(this)'>单选1
    <input type="radio" name='radio2' value="2" onclick='check(this)'>单选2
    </form>
    <script>
    var tempradio= null;
    function check(checkedRadio)
    {
    if(tempradio== checkedRadio){
    tempradio.checked=false;
    tempradio=null;
    }
    else{
    tempradio= checkedRadio;
    }
    }
    </script>


    方法二:
  • 相关阅读:
    三数之和
    167
    二分搜索树
    687
    索引堆
    二分查找 leetcode704
    leetcode 56合并区间 java
    leetcode 1046
    堆的数据结构java
    leetcode 493
  • 原文地址:https://www.cnblogs.com/cx709452428/p/6210969.html
Copyright © 2011-2022 走看看