How to select all checkboxes using JQuery

Posted 24 August 2017 by Darren Welch


It's actually very simple...


We select the ID of the select all checkbox and use the .change() function.


$("#selectAll").change(function() {})


Within the change function we use a JQuery selector to find all checkboxes and the .prop function to set it's checked value to the same value as the selectall checkbox


$("input:checkbox").prop('checked', $(this).prop("checked"));


You can fiddle with the code here and test it out.


Darren Welch


Darren Welch

  24 August 2017

Contact me online



JQuery javascript code programming

Has this helped?

If this has saved you time and you are feeling generous, why not buy me a coffee.

Thank You cup of coffee

Related Content

How to create templates using HTML, JSON & Jquery

20 Jun 2018

Bat and ball game built with HTML & JS

03 May 2018