I have a table that contains multiple checkboxes in each row. I need to get the value of each individual checkbox. I've been able to do something like the following to retrieve the value of a checkbox in the first column of a table...
$('#myTable tbody tr td:first-child input:checkbox').each(function() {
if (this.checked) {
//Do something
}
});
But now I need to iterate over each row, and get the value of each individual checkbox. This is what I've been trying for a specific checkbox...
if($(this).find(':input[type="checkbox"]').eq(0).attr('checked')) {
myVariable = 'so and so';
}
else {
myVariable = 'something else';
}
Which doesn't work. Any suggestions on how I can get this working?