lundi 28 août 2017

Select checkboxes in a row [on hold]

I need a script that will run on click and check if 4 checkboxes are selected. The important thing that checkboxes must be selected in a row, the order I select them doesn't matter they just must be in a row like: 4,5,6,7 or: 7,8,9,10 and so on. Not sure if this piece of code example will come in handy:

<ul id="checkbox-list">
   <li><input type="checkbox">1</li>
   <li><input type="checkbox">2</li>
   <li><input type="checkbox">3</li>
   <li><input type="checkbox">4</li>
   <li><input type="checkbox">5</li>
   <li><input type="checkbox">6</li>
   <li><input type="checkbox">7</li>
   <li><input type="checkbox">8</li>
   <li><input type="checkbox">9</li>
   <li><input type="checkbox">10</li>
</ul>

<button id="checking">Check</button>

Thanks




Aucun commentaire:

Enregistrer un commentaire