HTML DOM name 屬性
定義和用法
name 屬性可設(shè)置或返回密碼域的名稱。
語(yǔ)法
passwordObject.name=name
實(shí)例
下面的例子可獲得密碼域的名稱:
<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>