我正在使用带有 jQuery UI 复选框的表单,但我遇到了一些问题:
这是我的代码:php
<input type="checkbox" id="check'. $empl->getAttr('id') .'" class="intervenants" /><label for="check'. $empl->getAttr('id') .'">'.$empl->getAttr('nom').'</label>';
javascript
$('.intervenants').each(function() {
$(this).attr('checked',false);
});
for(i = 0; i < data.list_empl.length; i++) {
$('#check'+data.list_empl[i].id).attr('checked',true);
}
如您所见,我希望取消选中所有复选框,然后查看数组并尝试仅选中数组中存在的复选框。问题是它不起作用...
我不知道什么不起作用,我试图发出警报,以查看 html,但它看起来完全不连贯。
非常感谢您的帮助,在此先感谢,
卢卡。