SoFunction
Updated on 2025-04-03

js read content from the input box and compare the size of two numbers

Because the content read from the input box is of String type, if you compare directly, you use Asc code to compare. If you want to compare the size of the number, you should add parseFloat.

for example:

if(parseFloat(amnt1) < parseFloat(amnt2)){}

The above article js reads content from the input box, and compares the size of two numbers is all the content I share with you. I hope you can give you a reference and I hope you can support me more.