W3School TIY
脚 本 学 堂 www.jbxue.com
编辑您的代码:
<html> <body> <form> Email: <input type="text" id="email" name="email" /> </form> <p>The name of the text field is: <script type="text/javascript"> x=document.getElementById('email'); document.write(x.name); </script></p> </body> </html>
查看结果: