size 属性可设置或返回密码域的大小(以字符数计)。
passwordObject.size=number_of_chars
下面的例子更改了密码域的大小:
<html>
<head>
<script type="text/javascript">
function changeSize()
{
document.getElementById("password1").size=40
}
</script>
</head>
<body>
<form>
<input type="password" id="password1" />
<input type="button" id="button1" onclick="changeSize()"
value="Change size of the password field" />
</form>
</body>
</html>