我有HTML:如何选择一组复选框...?
<tr>
<td><input type="checkbox" value="3" id="userListingSelect0" cssclass="cbDelete">
</td><td>general</td>
<td><a href="editUser.aspx?userId=3">Edit</a></td>
</tr>
<tr>
<td><input type="checkbox" value="1" id="userListingSelect1" disabled="disabled" cssclass="cbDelete">
</td><td>hmladmin</td>
<td><a href="editUser.aspx?userId=1">Edit</a></td>
</tr>
而且我尝试使用jQuery来得到所有的复选框。
即时通讯使用:
console.log(jQuery('.cbDelete').html());
但所有IM越来越不确定。我如何...
1)获取所有元素 2)遍历它们?
我试着使用:
jQuery('.cbDelete').each(function() {
console.log('got here');
if (this.checked) {
selectionMade = true;
}
resultsGot = true;
});
而且它仍然没能到“来到这里”行,以便它看起来像我不能去收集。不知道为什么....
是的是一个错字,我完全忘了把它叫做类是getitng混淆天冬氨酸之间。网和Html!谢谢 – Exitos