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”.

HTML Code

Simple HTML code contains 6 checkboxes and 2 div tags.

CSS Code

Our css file for better view.

Screenshot

checkboxes

checked

Demo

Live Demo
Facebook Comments
 

Agung Setiawan

Halo, perkenalkan saya Agung Setiawan. Seorang software developer, penulis buku, blogger, gunpla builder, tech educator dan yang paling penting console gamer.

 
Halo, perkenalkan saya Agung Setiawan.
Seorang software developer, penulis buku, blogger, gunpla builder, tech educator dan yang paling penting console gamer.
Selain di blog ini saya cukp aktif juga main di Twitter @agungsetiawanmu dan Facebook serta Instagram.
Mau belajar programming bareng? Cek YouTube channel saya.
Mau belajar Vim bareng saya?

Leave a Reply

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