Jquery Check Uncheck All Checkboxes

checkall FI

If you are developing application that has quite number of checkbox, you should consider to make a check/uncheck all checkboxes feature to facilitate if users want to choose all the options in effective way rather than click it one by one. Today let’s take a look at how we make it possible to check all options in only one click.

JavaScript Code

Quite simple, we only use single line of code. Look at the highlighted code, we try to find checkboxe inside the id=”checkboxes” and set the attribute of “checked”.


Simple HTML code contains 6 checkboxes and 2 div tags.

CSS Code

Our css file for better view.





Live Demo
Facebook Comments

Agung Setiawan

Agung Setiawan adalah software engineer di BukaLapak.com, penulis sekaligus pecinta sastra, dan pembaca buku

Halo, perkenalkan saya Agung Setiawan.
Seorang Software Engineer di BukaLapak, penulis buku, blogger, gunpla builder, tech educator.
Simak pemikiran saya soal dunia Software Engineering via Twitter di @agungsetiawanmu dan facebook
Mau belajar Vim bareng saya?
Belajar ngoding dari nol menggunakan PHP

Leave a Reply

Your email address will not be published. Required fields are marked *