为什么不直接
alert(document.getElementById("dd").value);

解决方案 »

  1.   


    <html> 
    <head> 
    <script> <title> I'll   go   and   quit   my   job   in   the   freedom   company!!   </title> 
    function   ss() 

      
      alert(document.Form1.dd.value); 
      } </script> 
    </head> 
    <body> 
    <form   id="Form1"   method="post"> 
    <input   type="text"   name="dd" id="dd"   onblur="ss()"> </form> 
    </body> 
    </html> 
      

  2.   


    <html> 
    <head> 
    <script> <title> I'll   go   and   quit   my   job   in   the   freedom   company!!   </title> 
    function   ss() 

      
      alert(document.Form1.dd.value); 
      } </script> 
    </head> 
    <body> 
    <form   id="Form1"   method="post"> 
    <input   type="text"   name="dd" id="dd"   onblur="ss()"> </form> 
    </body> 
    </html> <input   type="text"   name="dd" id="dd"   onblur="ss()">
      

  3.   

    表单操作是用name而不是id的,只是ie能兼容两者所以很多时大家都忽略了。把form、input、textarea等的id都改为name是最好的。又或者用比较正道的操作方法如1楼的,又或者是document.forms[xxx].elements[xxxx].value
      

  4.   

    <form   id="Form1" name="Form1"  method="post"> --
    FORM加name属性试试
      

  5.   

    表单处与文本框处都少了name属性
    <html> 
    <head> 
     <title> I'll   go   and   quit   my   job   in   the   freedom   company!!   </title> 
    <script>
    function   ss() 

      
      alert(document.Form1.dd.value); 
      } </script> 
    </head> 
    <body> 
    <form  name="Form1"  id="Form1"   method="post"> 
    <input   type="text" name="dd"   id="dd"   onblur="ss()"> </form> 
    </body> 
    </html> 
      

  6.   

    用document.form这种方法对于初学者来说会比较容易理解面向对象哦..用多了,其实都一样..最后出现问题不也就是算法