samedi 4 août 2018

Hide divs based on number of check boxes checked

I want to hid divs based on number of check boxes checked. Div A is visible on page load while div B is hidden. If total number of checkboxes checked is equal 2 or great than 2 than i want to hide div A and show div B.

<input class="iput" type="checkbox" name="E33" value="33" stock="20"/> A 
<input class="iput" type="checkbox" name="E34" value="33" stock="6"/>
<input class="iput" type="checkbox" name="E646" value="33" stock="7"/>
<input class="iput" type="checkbox" name="E46" value="33" stock="7"/> 
<input class="iput" type="checkbox" name="E626" value="33" stock="7"/> 
<input class="iput" type="checkbox" name="E656" value="33" stock="7"/> 

    <div class="a"> Hello </div>
    <div class="b" style="display:none"> BYE </div>

Have constantly failed to achieve this.




Aucun commentaire:

Enregistrer un commentaire