How To Get Selected Checkboxes Value Using jQuery

In this tutorial we will learn how to get selected checkbox value using jQuery. Form input type checkbox have an array value because multiple checkbox can be selected. In previous tutorial we have discussed about how to get radio button checked value using jQuery. We will use jQuery selector with each method to get select checkbox value in an array.

User can select multiple checkbox in a form so we will get value of checkbox in an array. jQuery.each() method is used to loop through each element over both jQuery objects and arrays.

Let’s start.


<form method="POST">
<input type="checkbox" name="tutorial" value="PHP"><label>PHP</label> <br>
<input type="checkbox" name="tutorial" value="MySQL"><label>MySQL</label> <br>
<input type="checkbox" name="tutorial" value="jQuery"><label>jQuery</label><br>
<input type="checkbox" name="tutorial" value="AJAX"><label>AJAX</label><br>
<input type="checkbox" name="tutorial" value="JSON"><label>JSON</label><br>
<button type="button" id="btn">Submit</button>



First include jQuery library

<script src=""></script>

then we write script to get selected checkbox value in an array.

$(document).ready(function () {
$("#btn").on('click', function () {

var selValue = [];




alert("You have selected: " + selValue);



Leave a Reply

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