我有這些有更改事件的複選框。當我通過button.Change事件檢查這些複選框不會觸發。它出什麼問題了?當按鈕執行檢查操作時,更改不起作用
的Html
<button>aaa</button>
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
jQuery的
$(':checkbox').on('change',function(){
alert("checked");
});
$('button').on('click',function(){
$(':checkbox').prop('checked',true);
});
_via外部button_是什麼意思?你的意思是你旁邊的複選框的按鈕? – putvande
@putvande我的壞。編輯它按鈕:)。 yup nxt – Ace