Password size Property
Password Object
Definition and Usage
The size property sets or returns the width of a
password field (in number of characters).
The default value is 20.
Syntax
Set the size property:
passwordObject.size=integer
Return the size property:
Browser Support

The size property is supported in all major browsers.
Example
Example
Set the width of the password field:
<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>
Try it yourself »
Password Object
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]