In this tutorial, learn how to get selected checkboxes id on click using jQuery. Get id of all selected checkboxes or multiple selected checkboxes values or single selected checkbox.

Find the id of a checkbox and get its ids in an array format. Use the array format to get individual id using jQuery. You can also find how to allow only single selection of checkbox here. You may also like to read how to get selected checkbox value using jQuery.

Get Selected Checkboxes Id Using jQuery(Single Selection Only)

The single selected checkboxes allow selecting only one checkbox at a time. get selected checkboxes id on click of the button. See the below example to find how to get single selected checkbox id.

Output

Virat Kohli
Chris Gayle
Mahendra Singh Dhoni
Sachin Tendulkar
Donald Bradman

You have to select one checkbox, click any checkbox given above to get its id. You are allowed to select the only single checkbox at once.

Get Multiple Selected Checkboxes Id Using jQuery

If you want to find the ids for the multiple selected checkboxes. Find the ids of selected checkboxes and get it array format. See the example below to get the ids of all the selected checkboxes.

Output

Virat Kohli
Chris Gayle
Mahendra Singh Dhoni
Sachin Tendulkar
Donald Bradman

Click multiple checkboxes and get its ids in an array format. The above example is used to get multiple ids and use it in other ways.

Hope you like this tutorial of how to get selected checkboxes id on click using jQuery. If you have any query regarding the tutorial, please comment below.

Also tell me, which method are you using to find the selected checkbox id on click using jQuery.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.