jQuery example for most used checkbox operation

Checkbox operation jQuery, jQuery checkbox is checked, jQuery checkbox checked or not, jQuery checkbox event, jQuery example for most used checkbox operation, jQuery common operations on checkbox, jQuery example for most used checkbox operation.

jQuery most used checkbox code samples that will definitely help you in your regular coding work.

Example given for most used checkbox related jQuery coding samples that we know but always google when want to use.

How to check if checkbox is checked or not checked:

//Code returns true/false based on checked status

How to get value of checked checkbox:

<input class="chk-group" type="checkbox" name="first" id="first1" value="First"/>
<label for="first1">First</label><br/>
<input class="chk-group" type="checkbox" name="second" id="second1" value="Second"/>
<label for="second1">Second</label><br/>
<input class="chk-group" type="checkbox" name="third" id="third1" value="Third"/>
<label for="third1">Third</label><br/><br/>
<button onclick="getSelectChkVal();">Get selected checkbox values</button><br/>

function getSelectChkVal(){
var str = '';
var chkList = $('.chk-group');
$.each(chkList, function(key, chkObj){
  str += $(chkObj).val()+' ';

alert('SELECTED CHECKBOX VALUE:'+"\n"+str);

How to check/uncheck checkbox by jQuery:

$('#first').prop('checked', false);

$('#first').prop('checked', false);

Have you remember some more useful info for checkbox and jQuery? Share it here by comment section.
If you like this, don’t forget to share with others.