I am showing checkbox,article title,description,status in table(using javascript table which as sorting etc)
when i have 20 records,the table display 10 records per page,when i cl开发者_开发知识库ick checkall all the records selected i.e the 2 page records also selected...
i want to be like this ,when i click checkall one the page showing should be checked...
how to do that in javascript?
my script to checkall is this
function Checkall(){
$("INPUT[type='checkbox']").each(function(){
if (this.checked == false) {
//$("INPUT[type='checkbox']").attr('checked', this.checked);
this.checked = true;
$("#checkall").val("UnCheck All");
} else {
this.checked = false;
$("#checkall").val("Check All");
}
});
}
Try this:
$("INPUT[type='checkbox']:visible")
to select only visible check boxes
精彩评论