vendredi 27 juillet 2018

Count total number of checkboxes what are checked and show on page via JS

I want to show the total number of checkboxes that user has selected on the page. Here is my code.

<input type="checkbox" name="fruit" />A
<input type="checkbox" name="fruit" />B
<input type="checkbox" name="fruit" />C

<p>Total Number of Items Selected = <p>  

Please provide the javascript code needed to achieve this.




Aucun commentaire:

Enregistrer un commentaire