I have recently started javascript at college and am having a little trouble. I am not Including my code here as i dont want it written for me i just need some pointing in the right direction.
So, I have three checkboxes, each with a different value and i need to add together the values for the selected boxes. I understand how to do this but the way im doing it seems a bit long winded and im sure there is a better way.
Currently i have an if statement checking if box1 box2 and box3 are selected, if they are then they are added, else if box 1 and box2 are selected they are added, else if box1 and box2 are selected they are added and so on.
so basically im checking every combination of what boxes can be selected, one at a time. There must be a more efficient way of achieving this so any tips would be appreciated. Thanks in advance for any help.