I wnat to get values from input elements as numbers and count them with jQuery. I'm trying, but result is not on decimal. How to fix that problem ?
HTML
<input name="test1" value="1.77" type="hidden" />
<input name="test2" value="1.23" type="hidden" />
jQuery
var a = parseInt($( "input[name='test1']").val(), 10);
var b = parseInt($( "input[name='test2']").val(), 10);
alert( a + b ); // should be 3, but it is only 2
Here is an example -> jsfiddle Example