I have the 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>
And im trying to use jQuery to get all of the checkboxes.
Im using:
console.log(jQuery('.cbDelete').html());
But all im getting is undefined. How do I…
1) Get all the elements
2) Iterate through them?
I tried using:
jQuery('.cbDelete').each(function () {
console.log('got here');
if (this.checked) {
selectionMade = true;
}
resultsGot = true;
});
And still it didn’t get to to the ‘got here’ line so it looks like I cant get to collection. Not sure why….
The reason why this line doesn’t work is because of the
cssclassattributeChanging it to
classwill make this work. Or the answer from Igor.