0

I have the following HTML code. I have made number of checkboxes. I want to retrieve the checked checkboxes's value using jquery. How can I do that?

<input type="checkbox" value="apple" name="box[]">apple     
<input type="checkbox" value="mango" name="box[]">Mango
<input type="checkbox" value="strawberry" name="box[]">Strawberry
Aisarangh
  • 11
  • 5

1 Answers1

0

Try

$('input:checked').each(function() {
  console.log($(this).val());
});
Rajaprabhu Aravindasamy
  • 66,513
  • 17
  • 101
  • 130