HTML DOM name 属性
定义和用法
name 属性可设置或返回密码域的名称。
语法
- passwordObject.name=name
实例
下面的例子可获得密码域的名称:
- <html>
- <body>
- <form id="form1">
- <input type="password" id="password1" name="password1" />
- </form>
- <p>The name of the password field is:
- <script type="text/javascript">
- x=document.getElementById('password1');
- document.write(
x.name
);- </script></p>
- </body>
- </html>