Using Javascript to compare two input numbers in HTML?

前端 未结 4 2083
没有蜡笔的小新
没有蜡笔的小新 2020-12-07 03:55

I am using Notepad++ to create a simple web page where a user types in two numbers into a text box, and then presses a button. When they press the button something comes up

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-07 04:22

    Convert to floats.

    value1 = parseFloat(document.First_num.value);
    value2 = parseFloat(document.last_num.value);
    

提交回复
热议问题