how to select all table rows
<p>I have a table which contain more than 700 rows which its data shown in a grid and in a different pages so that each page include 20 rows. I need a button in the first page so that whenever it click all 700 rows select.
There is a check box in each row and I wanna they checked all when user click the button.
For handle it I put a button in page so that when user click it all rows check.</p>

<pre><code>$("#selectallboxes").click ( function () {
         $('#userTable input[type=checkbox]').attr('checked', 'checked');
    })
</code></pre>

<p>HTML code:</p>

<pre><code>&lt;input type='button' value='select all rows' id='selectallboxes' name='selectallboxes' /&gt;
</code></pre>
