【发布时间】:2015-12-21 10:48:32
【问题描述】:
我有 HTML 代码:
<input type="checkbox" name="all" value="all">ALL
<input type="checkbox" name="agent" value="agent" >Agent
<input type="checkbox" name="company" value="company">Company
<input type="checkbox" name="branch" value="branch">Branch
如果我选中all,other checkbox会被禁用,如果我取消选中,other checkbox会重新启用。
我试过这样做,使用下面的脚本。
$("input[name='all']").change(function() {
if(this.checked) {
$("input[name='agent']").prop("disabled",true);
}
});
【问题讨论】: