I am working on some kind of calculator, and lets say i have a global variable called IQ. Now, I have a checkbox with 5 options (in this case 5 different persons). I want each person to either reduce or increase the global variable IQ when they are selected.
I thought about doing this with if statements, but what if the first if is true(i.e one person is checked and value === person). Then the code would stop right and not check the other if-statements to see if more persons/checkboxes are selected. Hope this is clear what i ment.
This is my HTML-code:
<input type="checkbox" name="person" value="frank"> Frank Aarebrot<br>
<input type="checkbox" name="person" value="gaben"> Gabe Newell<br>
<input type="checkbox" name="person" value="lance"> Lance Armstrong<br>
<input type="checkbox" name="person" value="trond"> Trond Kirkvaag<br>
<input type="checkbox" name="person" value="davy"> Davy Wathne<br>