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

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

 
Halo, perkenalkan saya Agung Setiawan.
Saya Software Engineer di BukaLapak.
Simak pemikian saya soal dunia Software Engineering via Twitter di @agungsetiawanmu dan facebook
Blog ini saya update seminggu sekali jadi sering-sering saja mampir
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 *