0

I have below piece of html. it has UI with LI's each having a check box in it. Now i want to know values of all thoses li's which have been checked. but i am not able to think how to do it. is there any function or method to do this.

HTML :

<ui>
<li><input type="checkbox" class="left select-all"><h3>Select all</h3><div class="clear"></div>
</li><li class="sub_checkbox_list_box">
<input type="checkbox" class="left selector" value=8>
<h3>ruleSetproductSelectionFilterTrial1</h3>
<input type="hidden" value=2013-12-25>
<div class="clear"></div>
</li>

<li class="sub_checkbox_list_box">
<input type="checkbox" class="left selector" value=12>
<h3>ruleSetSudhanshuSelectAllBugTrial2</h3>
<input type="hidden" value=2013-12-27>
<div class="clear"></div>
</li>

<li class="sub_checkbox_list_box">
<input type="checkbox" class="left selector" value=13>
<h3>ruleSetSelectAllBugTrial3Sudh</h3>
<input type="hidden" value=2013-12-27>
<div class="clear"></div>
</li>
</ui>
user2696466
  • 650
  • 1
  • 14
  • 33

1 Answers1

1

Here is simple method,

var checkedValues = $("li input[type=checkbox]:checked").map(function () {
  return $(this).val();
});
console.log(checkedValues.get());
Deepak Ingole
  • 14,912
  • 10
  • 47
  • 79