Get Multiple Checkbox Values Using jQuery | Code Snippet

Get-Multiple-Values-From-Checkbox-Using-jQueryCode Snippet #8: The code snippet we found for today can get multiple values from checkbox using jQuery. Get multiple values from checkboxes using jQuery dynamcally.

In one of our previous code snippet, we saw how to fetch multiple checkbox values with JavaScript. This time around, we are going to achieve the same thing using jQuery.

We know this this code won’t work without the jQuery framework inserted into the HTML document. This code can be really helpful in your upcoming or on going projects based on jQuery where you may need to get multiple checkbox values using jquery alone and the same may be needed to be passed to some other function or object.

Demo: [ Select one or more checkboxes below and hit the fetch values button ]




The above code we have here is initiated on load of the window usign the below code snippet:

We store the values from the input checkboxes to the variable by name “valList” and add a comma after every value fetched. Once the input tag with button as the id is clicked, a alert box is generated, the function valList() is called where the values from the input are stored and only those checked are shown on the alert window using the statement:

Hope you liked this code. If you have any enhancements in mind, please let us know the same via comment.


Vinod Suthersan is a enthusiastic web designer still learning new things on web designing. He loves designing, hunting new designs, blogging, and crazy about Internet. Know more

You may also like...

3 Responses

  1. ashis says:

    not working above script on click not diaplaying

  2. prabhu says:

    great work. thanks