I have a table containing several checkboxes in each row. I need to get the value of each individual checkbox. I was able to do something like the following to get the checkbox value in the first column of the table ...
$('#myTable tbody tr td:first-child input:checkbox').each(function() {
if (this.checked) {
}
});
But now I need to iterate over each row and get the value of each individual flag. This is what I tried for a specific checkbox ...
if($(this).find(':input[type="checkbox"]').eq(0).attr('checked')) {
myVariable = 'so and so';
}
else {
myVariable = 'something else';
}
What does not work. Any suggestions on how I can make this work?
source
share