Select All checkboxes using jQuery

Today, We want to share with you Select All checkboxes using jQuery.In this post we will show you Select / Deselect all checkboxes using jQuery, hear for select multiple rows with checkboxes using jquery we will give you demo and example for implement.In this post, we will learn about how to check all checkbox is selected in jquery with an example.

Select All checkboxes using jQuery

There are the Following The simple About Select All checkboxes using jQuery Full Information With Example and source code.

As I will cover this Post with live Working example to develop jquery select all checkboxes in table, so the select all checkbox jquery datatable for this example is following below.

Read Also:  url download file - How to download a file from a URL?

include the jQuery library

Step 1: jQuery Code

$(document).ready(function(){
    $('#check_all').on('click',function(){
        if(this.checked){
            $('.liveitem').each(function(){
                this.checked = true;
            });
        }else{
             $('.liveitem').each(function(){
                this.checked = false;
            });
        }
    });
    
    $('.liveitem').on('click',function(){
        if($('.liveitem:checked').length == $('.liveitem').length){
            $('#check_all').prop('checked',true);
        }else{
            $('#check_all').prop('checked',false);
        }
    });
});


Step 2: HTML Code

<ul class="main">
    <li> Check all</li>
    <ul>
        <li>product 1</li>
        <li>product 2</li>
        <li>product 3</li>
        <li>product 4</li>
        <li>product 5</li>
    </ul>
</ul>

Web Programming Tutorials Example with Demo

Read :

Read Also:  jquery uncheck all checkboxes Multiple Checkbox Example

Summary

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

I hope you get an idea about Select All checkboxes using jQuery.
I would like to have feedback on my infinityknow.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.