Hello i´m a beginner in javascript
This works with 2+2+2=6
but not work with 2.5 +2.5+ 2.5 =7.5
<input type="text" id="my_input1" value=""/>
<input type="text" id="my_input2" value="" />
<input type="text" id="my_input3" value="" />
<input type="text" id="result" value="" onfocus="doMath();" />
<script type="text/javascript">
function doMath()
{
// Capture the entered values of two input boxes
var my_input1 = document.getElementById('my_input1').value;
var my_input2 = document.getElementById('my_input2').value;
var my_input3 = document.getElementById('my_input3').value;
// Add them together and display
var sum = parseInt(my_input1) + parseInt(my_input2) + parseInt(my_input2);
document.getElementById('result').value =(sum);
}
</script>
</body>
</html>