checkbox selector in jQuery with example

Checkbox selector returns all input elements with type checkbox.

Example 1 :

    <title>checkbox Selector</title>
    <script type="text/javascript" src=""> </script>
    <script type="text/javascript">
    <input type="checkbox" name="BE"  id="Qualification">BE
    <input type="checkbox" name="ME"  id="Qualification">ME
    <input type="checkbox" name="BSC"  id="Qualification">BSC
    <input type="checkbox" name="MBA"  id="Qualification">MBA
    <button id="myButton">Click Me</button>
    <button onclick="location.reload();">Reset</button>

Demo :

In the above example, we have used checkbox selector. Checkbox selector return all input elements with type checkbox. In the above example the checkbox selector selects the third checkbox on button click and checks it.


Post a Comment