首页 > 其他 > 详细

将页面中所有的checkbox设成单选得

时间:2019-04-12 22:49:14      阅读:119      评论:0      收藏:0      [点我收藏+]
$(function () {
var allBox = $(":checkbox");
allBox.click(function () {
allBox.removeAttr("checked");
$(this).attr("checked", "checked");
});
});
 
 
$(function(){
$(‘:checkbox[name=jcxflIds]‘).each(function(){
$(this).click(function(){
if($(this).attr(‘checked‘)){
$(‘:checkbox[name=jcxflIds]‘).removeAttr(‘checked‘);
$(this).attr(‘checked‘,‘checked‘);
}
});
});
 
});

将页面中所有的checkbox设成单选得

原文:https://www.cnblogs.com/zhuyeshen/p/10699033.html

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