My html
<TR class="datarow" id="rowId"><TD>1</TD><TD>895171</TD><td class="classID"><INPUT type="checkbox" /></TD></TR>
how do I use Jquery to find out whether the checkbox in this particular row is checked or not. Assume that i know the unique rowId.
Currently, I am doing this
var checkbox = $('#' + rowId + " td input:checkbox");
if (checkbox.checked) {
alert("checked");
} else {
alert("unchecked");
}
But this doesn't seem to detect when the checkbox is checked.
EDITED Curiously, the following didn't work either:
var curRow = $('#' + curRowId);
var checkbox = $(curRow).find('input:checkbox').eq(0);
if (checkbox.checked) {
alert("checked");
} else {
alert("unchecked");
}