Javascript number comparison fails

前端 未结 2 538
栀梦
栀梦 2020-11-29 12:47

I\'m trying to understand where is my error, because it\'s not possible that JS fails in math!

On the HTML form I have a select and 9 text input. Then, on the JS I c

2条回答
  •  一整个雨季
    2020-11-29 12:52

    You will have to parse the value before comparison

    user parseInt to convert to integer numeric values, or parseFloat to convert to float values

    parseInt Help parseFloat Help

提交回复
热议问题