Javascript - returning concatenates instead of sum of variables from input

前端 未结 6 927
南笙
南笙 2021-01-23 07:12

I am trying to get values from input field using .each() and adding them to show the sum in another input value. But unfortunately in spite of using parseInt() I am

6条回答
  •  情深已故
    2021-01-23 07:56

    your appending String. $(this).val() is a string . just parse it to int or float.

提交回复
热议问题