HTML DOM disabled 属性

定义和用法

id 属性设置或返回文本域的 id。

语法

  1. textObject.id=id

实例

本例设置了该文本域的 id:

  1. <html>
  2. <body>
  3.  
  4. <form>
  5. <input type="text" id="text1" />
  6. </form>
  7.  
  8. <p>The id of the text field is:
  9. <script type="text/javascript">
  10. x=document.getElementById('text1');
  11. document.write(x.id);
  12. </script></p>
  13.  
  14. </body>
  15. </html>