HTML DOM type 属性
定义和用法
type 属性可设置表单元素的类型。对于密码域,该属性总是 "password"。
语法
- passwordObject.type
实例
下面的例子返回了该密码域的表单元素类型:
- <html>
- <body>
- <form>
- <input type="password" id="password1" />
- </form>
- <script type="text/javascript">
- x=document.getElementById("password1");
- document.write("Form element type is: ");
- document.write(
x.type
);- </script>
- </body>
- </html>