jQuery Check Uncheck All Checkbox Examples

Today, We want to share with you jQuery Check Uncheck All Checkbox Examples.In this post we will show you check and uncheck all checkbox using javascript, hear for Check Uncheck All Checkbox using jQuery we will give you demo and example for implement.In this post, we will learn about select deselect all checkboxes using jquery with an example.

jQuery Check Uncheck All Checkbox Examples

There are the Following The simple About jQuery Check Uncheck All Checkbox Examples Full Information With Example and source code.

As I will cover this Post with live Working example to develop jquery uncheck all checkboxes with same name, so the uncheck all checkboxes jquery in div, uncheck checkbox jquery for this example is following below.

Check Uncheck All Checkbox using jQuery

The HTML Source code is given below

<body>
<h2>Select all checkbox using jquery Example</h2>
<div class="row well">
    <div class="col-md-3 "> 
        Select All : <input id="select_all" class='' type="checkbox" >
    </div>
   <hr/>
    <div class="col-md-3" >
        Product 1 :<input value="1" class='get_check' type="checkbox" name="checkboxes[]">
    </div>
    <div class="col-md-3" >
        Product 2 :<input value="2" class='get_check' type="checkbox" name="checkboxes[]">
    </div>
    <div class="col-md-3" >
        Product 3 :<input value="3" class='get_check' type="checkbox" name="checkboxes[]">
    </div>
   <div class="col-md-3" >
        Product 4 :<input value="3" class='get_check' type="checkbox" name="checkboxes[]">
    </div>
    <div class="col-md-3" >
        Product 5 :<input value="3" class='get_check' type="checkbox" name="checkboxes[]">
    </div>
        <div class="col-md-3" >
        Product 6 :<input value="3" class='get_check' type="checkbox" name="checkboxes[]">
    </div>

</div>
</body>

The Jquery Source Code is given below.

<script>
 $("#select_all").click(function (){
     if ($("#select_all").is(':checked')){
        $(".get_check").each(function (){
           $(this).prop("checked", true);
           });
        }else{
           $(".get_check").each(function (){
                $(this).prop("checked", false);
           });
        }
 });
</script>

jQuery simple Uncheck/Check All Checkboxes

Read Also:  Select / Deselect all checkboxes using jQuery

Now the Simple jquery function first check whether all id named select_all is checked or not if Data checked it will iterate all checkboxes(Select / Deselect all checkboxes using jQuery) with under the class checkboxes using each function in simple (jQuery Uncheck/Check All Checkboxes). At each (Jquery Checkbox check all) iteration the checkbox is checked using jquery prop function which change or data set the property of HTML checkbox to true.

Read Also:  How to Check Uncheck All Checkboxes Using Jquery?

Full Example : Select all checkbox using jquery

<!DOCTYPE html>
<html>
<head>
<title>Select all checkbox using jquery</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<h2>Select all checkbox using jquery Example</h2>
<div class="row well">
    <div class="col-md-3 "> 
        Select All : <input id="select_all" class='' type="checkbox" >
    </div>
   <hr/>
    <div class="col-md-3" >
        Product 1 :<input value="1" class='get_check' type="checkbox" name="checkboxes[]">
    </div>
    <div class="col-md-3" >
        Product 2 :<input value="2" class='get_check' type="checkbox" name="checkboxes[]">
    </div>
    <div class="col-md-3" >
        Product 3 :<input value="3" class='get_check' type="checkbox" name="checkboxes[]">
    </div>
   <div class="col-md-3" >
        Product 4 :<input value="3" class='get_check' type="checkbox" name="checkboxes[]">
    </div>
    <div class="col-md-3" >
        Product 5 :<input value="3" class='get_check' type="checkbox" name="checkboxes[]">
    </div>
        <div class="col-md-3" >
        Product 6 :<input value="3" class='get_check' type="checkbox" name="checkboxes[]">
    </div>

</div>
<script>
 $("#select_all").click(function (){
     if ($("#select_all").is(':checked')){
        $(".get_check").each(function (){
           $(this).prop("checked", true);
           });
        }else{
           $(".get_check").each(function (){
                $(this).prop("checked", false);
           });
        }
 });
</script>

</body>
</html>

Angular 6 CRUD Operations Application Tutorials

Read :

Read Also:  Check Uncheck All Checkboxes using jQuery Selectors

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about jQuery Check Uncheck All Checkbox Examples.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.