$(document).ready(function() { var fanxiBox = $("#contentTable input:checkbox"); fanxiBox.click(function () { if(this.checked || this.checked=='checked'){ fanxiBox.removeAttr("checked"); //这里需注意jquery1.6以后必须用prop()方法 //$(this).attr("checked",true); $(this).prop("checked", true); checkClickDetail(); } }); }); ---------- $(function( ){ $(":checkbox[name='detail_flag_check']").each(function(){ $(this).click(function(){ if($(this).attr('checked')){ $(":checkbox[name='detail_flag_check']").removeAttr('checked'); $(this).attr('checked','checked'); } }); }); });
单选checkbox
最新推荐文章于 2024-02-02 15:24:02 发布