jquery

Check and Uncheck all checkboxes using jquery

Posted on Updated on

There are some simple things to do in programming yet some developers find it tough. This is an example of checking all the checkboxes in a page using jquery. For this to work , you need jquery.js file included in your page.

This is the body part with all the checkboxes:

          <table>
<tr>
<td align=”left” colspan=”4″><input type=”checkbox”  class=”checkAll”></td>
</tr>
<tr>
<td> <input type=”checkbox” name=”myChkBox”  class=”selectedId” id=”myChkBox1″ /> </td>

<td> <input type=”checkbox” name=”myChkBox”  class=”selectedId”
id=”myChkBox2″ /> </td>
<td> <input type=”checkbox” name=”myChkBox”  class=”selectedId”
id=”myChkBox3″ /> </td>
<td> <input type=”checkbox” name=”myChkBox”  class=”selectedId”
id=”myChkBox4″ /> </td>
</tr>
</table>

Read the rest of this entry »

Advertisements