LearnFast.Ninja

jQuery get values of all checked checkboxes

How to get and read all checked values from the multi checkbox Html group using jQuery and each loop.

Step 1: The Html part.

<input type="checkbox" name="Interested" value="Insurnace" />Insurnace

<br />

<input type="checkbox" name="Interested" value="Electricity" />Electricity

<br />

<input type="checkbox" name="Interested" value="Mortgage" />Mortgage

<br />

<input type="checkbox" name="Interested" value="Gas" />Gas


Step 2: The jQuery part.

$("input:checkbox[name=Interested]:checked").each(function () {

    alert($(this).val());

});


Result:


Tags

jquery

checkbox