<script language="JavaScript">
function test()
{
                if((form1.START.value+0)>(form1.END.value+0))
                {
                            ....;
                }
return;
}
</script>或者 parseInt()

解决方案 »

  1.   

    parseInt()怎么用:
     是parseInt(form1.START.value)吗?谢谢
      

  2.   

    Google一下就什么都有了。
    document.write("<BR>" + parseInt("50"))
    document.write("<BR>" + parseInt("50.12345"))
    document.write("<BR>" + parseInt("32.00000000"))
    document.write("<BR>" + parseInt("71.348  92.218  95.405"))
    document.write("<BR>" + parseInt("         37 aardvarks"))
    document.write("<BR>" + parseInt("Awarded the best wine of 1992")) 
     
    Output: 
    50
    50
    32
    71
    37
    NaN
      

  3.   

    You can use the optional radix argument to convert a binary number string to the decimal (base 10) equivalent. 
     
    Code: 
    document.write(parseInt("110", 2)) 
     
    Output: 

     
    You can use the optional radix argument to convert a hexidecimal number string to the decimal (base 10) equivalent. 
     
    Code: 
    document.write(parseInt("0xD9", 16)) 
     
    Output: 
    217 
     
    You can use the isNaN function to see if the returned value is a NaN. 
     
    Code: 
    pet = "Rachel has 312 baby aardvarks"
    CheckNum = parseInt(pet)
    if(isNaN(CheckNum))
       {
         document.write("<BR>Sorry, CheckNum is a NaN")
         document.write("<BR>Left-most character = " + pet.substring(0,1))
       } 
     
    Output: 
    Sorry, CheckNum is a NaN
    Left-most character = R
      

  4.   

    <script language="JavaScript">
    function test()
    {
                    if(parsInt(form1.START.value)>parsInt(form1.END.value))
                    {
                                ....;
                    }
    return;
    }
    </script>
      

  5.   

    从语法上讲,这样可以吗?
    <script language="JavaScript">
    function test()
    {
                      form1.ABC.value=form1.START.value+form1.END.value;
    return;
    }
    </script>