I have the following html code:
<tr>
<td class="right">
<label class="input-control tiny-checkbox" onclick="">
<input type="checkbox" value="0"/>
<span class="helper"></span>
</label>
</td>
...
I have the following jQuery code:
$("table tbody tr td").click(function () {
var col = $(this).parent().children().index($(this));
var row = $(this).parent().parent().children().index($(this).parent());
if (col == 0) {
// col checkbox -> highlight the line (on/off)
var checked = $(this).children(':checkbox').is(':checked');
The checked var is never true even if the ckeckbox is checked. I don’t know why.
Any idea?
You have to use
findinside ofchildrenbecause children checks in direct child element,not in grand child.