我有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