我希望根据复选框的点击/取消点击事件设置一个变量(pageselected)。
HTML代码如下:
<thead>
<tr id="othercheckbox">
<th width="10"><input type="checkbox" name="zip" class="all" value="all" /></th>
</tr>
</thead>
JS文件中的代码如下:
$('#othercheckbox').click(function() {
if($(this).is(':checked')){
console.log("CCCCheckeddddddd");
that.pageselected = true;
}
else
{
console.log("UNCheckeddddddd");
that.pageselected = false;
}
}
但是这并没有按照预期的行为。我做错了什么吗?