首页 > Web开发 > 详细

使用jquery实现单选框、多选框取消选中状态

时间:2016-11-14 17:17:03      阅读:231      评论:0      收藏:0      [点我收藏+]
function radioReset(){
    /*方式一*/
    /* var radios = $("input[type=‘radio‘]");
     for (i=0; i<radios.length; i++){
         if(radios[i].checked){
              radios[i].checked = false;
          } 
     } */
     /*方式二*/
    $("input[type=‘radio‘]").removeAttr(‘checked‘);      
}

 <input type="button" class="button_gray" value="重 填" onclick="radioReset();">

切记 :如果在input类型为reset的上面添加onclick="radioReset();"如:

<input type="reset" class="button_gray" value="重 填" onclick="radioReset();">

取消选中的js代码不生效

使用jquery实现单选框、多选框取消选中状态

原文:http://www.cnblogs.com/super-chao/p/6062403.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!