mardi 30 août 2016

How to check if all of the checkbox are checked

How can I check if all of my checkboxes are checked or unchecked with jquery,I have child and grandchild input elements-

codepen setup : http://ift.tt/2bzB3Zn

<ul id="treeList">
  <li>
    <input type="checkbox" name="selectedRole"> mCRC
  <ul>
  <li>
    <input type="checkbox" name="selectedRole"> STIVARGA Efficacy
    <ul>
      <li>
        <input type="checkbox" name="selectedRole"> Long-Term Responders
      </li>
      <li>
        <input type="checkbox" name="selectedRole"> STIVARGA in Clinical Practice
      </li>
    </ul>
  </li>
  <li>
    <input type="checkbox" name="selectedRole"> STIVARGA AE Management
  </li>

  <li>
    <input type="checkbox" name="selectedRole"> Dosing
  </li>
  <li>
    <input type="checkbox" name="selectedRole"> Patient Communication
  </li>
  <li>
    <input type="checkbox" name="selectedRole"> Case Studies
  </li>
</ul>

<li>
  <input type="checkbox" name="selectedRole"> GIST
</li>




Aucun commentaire:

Enregistrer un commentaire