JavaScript中数字的比较

阅读更多
错误代码:
js 代码










 

正确代码:

js 代码










 

总结:

很显然,document.form1.b.value取得的值是String类型的。so you must chang it from string to int,there i use parseInt() which is a method in JS.

你可能感兴趣的:(JavaScript,HTML)