I wrote this code
$(document).on("click", "#tasksTable tr", function(e) {
var taskId = this.id;
var chkBoxCompleted = $(this).find('input:checkbox:first');
var chkBoxNotRequired = $(this).find('input:checkbox:last');
chkBoxCompleted.on('click', function(){
alert("called when I click second time on checkbox")
});
chkBoxNotRequired .on('click', function(){
alert("called when I click second time on checkbox")
});
});
and my html is like
<table width="100%" cellpadding="0" cellspacing="0" style="border-width: 0px 1px 1px 0px;" id="tasksTable">
<tr id="9">
<td class="blueFont_inset"><span>22/05/2014 00:48</span> </td>
<td class="blueFont_inset"><input type="checkbox" name="completedTask[]" id="completedTask" value="N"><span> </span></td>
<td class="blueFont_inset"><span>Completed Date</span> </td>
<td class="blueFont_inset"><input type="checkbox" name="notRequiredTask[]" id="notRequiredTask" value="N"><span> </span></td>
</tr>
</table>
These are multiple rows inside this table.
Click event of checkbox called when I click any of the checkbox second time. I tried it in IE and Chrome. Is this because I am using it inside table row click event? But I want to use that table row click event too.
I am using
<script src="//code.jquery.com/jquery-1.10.2.js"></script>