I want to set a variable (pageselected) as per the checkbox click/unclick
event.
<thead>
<tr id="othercheckbox">
<th width="10"><input type="checkbox" name="zip" class="all" value="all" /></th>
</tr>
</thead>
$('#othercheckbox').click(function() {
if($(this).is(':checked')){
console.log("CCCCheckeddddddd");
that.pageselected = true;
}
else
{
console.log("UNCheckeddddddd");
that.pageselected = false;
}
}
But this is not behaving as expected. Where am I going wrong?
You are checking the row is checked or not, which is not possible.bind onchange
event on the checkbox. put it on the checkbox let say checkbox1.
<input type="checkbox" name="zip" id="checkbox1" class="all" value="all" />
$('#checkbox1').change(function(){
if($(this).is(':checked')){
console.log("CCCCheckeddddddd");
}
else
{
console.log("UNCheckeddddddd");
}
});