我搜索了更多的時間,但它不工作,我想複選框被禁用,用戶不檢查,並可以檢查它,如果一些條件。好吧,現在,我試着禁用它們。使用jQuery 2.1.3如何禁用jquery複選框?
<input type="checkbox" class="checkbox1" id="chk" name="check[]" value="U01" />Banana
<input type="checkbox" class="checkbox1" id="chk" name="check[]" value="U02" />Orange
<input type="checkbox" class="checkbox1" id="chk" name="check[]" value="U03" />Apple
<input type="checkbox" class="checkbox1" id="chk" name="check[]" value="U04" />Candy
$(window).load(function() {
$('#chk').prop('disabled', true);
});
這不會沒有定義 – John11
disabled屬性它可以在我的電腦上工作。 ;) – GolezTrol
也許它取決於瀏覽器 – John11