|
<html> } |
正确代码:
|
<html> } |
总结:
很显然,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中的常见问题,即如何正确地比较两个输入框中数值的大小。通过使用parseInt()方法将字符串转换为整数,解决了直接比较可能引发的问题。
|
<html> } |
正确代码:
|
<html> } |
总结:
很显然,document.form1.b.value取得的值是String类型的。so you must chang it from string to int,there i use parseInt() which is a method in JS.
1328

被折叠的 条评论
为什么被折叠?