Password size 属性
定义和用法
size 属性可设置或者返回密码域的的宽度(数字字符)。
默认值为 20。
语法
设置 size 属性:
passwordObject.size=integer
返回 size 属性:
浏览器支持




所有主要浏览器都支持 size 属性
实例
设置密码域的宽度:
<html>
<head>
<script>
function setResult()
{
document.getElementById("pwd").size=40;
}
</script>
</head>
<body>
<form>
Password: <input type="password" id="pwd">
</form>
<button type="button" onclick="setResult()">Set width</button>
</body>
</html>