when i click check all all the records is selected even in the next page records(in javascript table)
<p>I am showing checkbox,article title,description,status in table(using javascript table which as sorting etc)</p>

<p>when i have 20 records,the table display 10 records per page,when i click checkall all the records selected i.e the 2 page records also selected...</p>

<p>i want to be like this ,when i click checkall one the page showing should be checked...</p>

<p>how to do that in javascript?</p>

<p>my script to checkall is this</p>

<pre><code>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");
        }
    });
} 
</code></pre>
