HTML DOM id 屬性
定義和用法
id 屬性設(shè)置或返回密碼域的 id。
語(yǔ)法
passwordObject.id=id
實(shí)例
下面的例子返回了該密碼域的 id:
<html>
<body>
<form id="form1">
<input type="password" id="password1" />
</form>
<p>The id of the password field is:
<script type="text/javascript">
x=document.getElementById('password1');
document.write(x.id
);
</script></p>
</body>
</html>