Hello i have 3 selectors , all selectors have some options with some values , how to sum all values of selected options ?
$('select').change(function(){
var sum = 0;
$('select :selected').each(function() {
sum += Number($(this).val());
});
$("#sum").html(sum);
});
http://jsfiddle.net/8mnQR/1/
var sum = parseInt($('select[name="anch1"]').val()) +parseInt($('select[name="anch2"]').val()) +parseInt($('select[name="anch3"]').val() )
You can do this