mardi 18 août 2015

fetch checked value from multiselect checkbox in jquery

I have given html

<ul class="ui-multiselect-checkboxes ui-helper-reset" style="height: 175px;">
  <li class=" ">
    <label class="ui-corner-all" title="" for="ui-multiselect-opps-option-0">
      <input type="checkbox" title="" value="All" name="opps" id="ui-multiselect-opps-option-0">
      <i>All</i>
    </label>
  </li>
  <li class=" ">
    <label class="ui-corner-all" title="" for="ui-multiselect-opps-option-1">
      <input type="checkbox" title="" value="1" name="opps" id="ui-multiselect-opps-option-1">
      <i>John</i>
    </label>
  </li>
  <li class=" ">
    <label class="ui-corner-all" title="" for="ui-multiselect-opps-option-2">
      <input type="checkbox" aria-selected="true" checked="checked"  title="" value="3" name="opps" id="ui-multiselect-opps-option-2">
      <i>Tim</i>
    </label>
  </li>
  <li class=" ">
    <label class="ui-corner-all" title="" for="ui-multiselect-opps-option-3">
      <input type="checkbox" aria-selected="true" checked="checked" title="" value="2" name="opps" id="ui-multiselect-opps-option-3">
      <i>Tom</i>
    </label>
  </li>
</ul>

and have included given jquery code

$("input[id^='ui-multiselect-opps-option']").attr('checked').val();

but its not fetching checked values please guide me how to fetch multiselect checked values through jquery.




Aucun commentaire:

Enregistrer un commentaire