Compare the size of two numbers:
The integers are as follows:
if(parseInt(xxx)>parseInt(xxxx)){
}
Decimals can be like this.
if(parseFloat(xxx)>parseFloat(xxxx)){
}
Wrong wording:
<script>
function check()
{
var num1=document.form1.num1.value;
var num2=document.form1.num2.value;
if(num2>num1) <!-错误写法-->
{
alert('num2 > num1!');
return false;
}
return true;
}
</script>