mercredi 14 septembre 2016

Check and summed if two or more checkbox is checked

I have an 4 input checkbox tag, and 1 div tag to display a price if one checkbox is checked

<input type="checkbox" value="None" id="check1" />
<input type="checkbox" value="None" id="check2" />
<input type="checkbox" value="None" id="check3" />
<input type="checkbox" value="None" id="check4" />
<div id="price"></div>

What i want to do if only 1 random checkbox is checked it will display number 1,800 on div#price, but if 2 checkbox is checked it will summed become 3,600 and so on until 4 checkbox. But i really confused how to do that using jQuery. Any idea?




Aucun commentaire:

Enregistrer un commentaire