Sum of two textfields - javascript

前端 未结 3 1058
日久生厌
日久生厌 2021-01-20 15:55

I found [this][1], rather difficult, javascript example online and I\'ve implemented it with success in my website.

However, I would like to get the result of, in th

3条回答
  •  情书的邮戳
    2021-01-20 16:33

    Replace:

    document.getElementById('total').value = parseInt(sum);
    

    With:

    document.getElementById('total').value = sum;
    

    You have already done all the int-parsing you need to do.

提交回复
热议问题