I got some select inputs where I need to create an array of their current selected val. I then need to get these values added together.
My HTML:
<select class="selectName" name="Select options" id="options1">
<option value="5.0000">10x4</option>
<option value="20.0000">10x8</option>
</select>
<select class="selectName" name="Select options" id="options2">
<option value="5.0000">10x4</option>
<option value="20.0000">10x8</option>
</select>
So far, I can get the current option:selected
value by doing:
optionsTotal = $.map($(".selectName").find('option:selected'), function (el, i) {
return $(el).val();
});
How can I add these values together to get a total? I just want the selected options total.
Here is a fiddle: http://jsfiddle.net/vdecree/e9zxY/34/