How To Get Multiple Checkbox Value In Javascript

WebSolutionStuff | Jan-10-2023 | Categories : Laravel PHP jQuery

In this article, we will see how to get multiple checkbox values in javascript. Here, we will learn to get the selected checkbox values using jquery. We will use the :checked selector for checkboxes and radio buttons. It can retrieve the selected value of the checkbox. When clicking on the checkbox we will push the value in the array using the push() function.

So, let's see get selected checkbox values in jquery, multiple checkbox checked values in javascript, get checkbox value in javascript, and get checkbox value in the javascript array.


<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Get Multiple Checkbox Value In Javascript - Websolutionstuff</title>
<script src=""></script>
  <h3>Get Multiple Checkbox Value In Javascript - Websolutionstuff</h3>
        <h3>Select languages:</h3>
        <label><input type="checkbox" value="laravel" name="language"> Laravel </label>
        <label><input type="checkbox" value="php" name="language"> PHP </label>
      <label><input type="checkbox" value="javascript" name="language"> JavaScript </label>
        <label><input type="checkbox" value="jquery" name="language"> jQuery </label>
        <label><input type="checkbox" value="mysql" name="language"> MySQL </label>
        <label><input type="checkbox" value="css" name="language"> CSS </label>
        <label><input type="checkbox" value="python" name="language"> Python </label>
        <button type="button">Get Selected Values</button><br>
      $(document).ready(function() {
              var arr = [];
              $.each($("input[name='language']:checked"), function(){
            $("p").text("Your selected languages are: " + arr.join(", "));




You might also like :

Recommended Post

Featured Post

Follow us
facebooklogo github instagram twitter