Password readOnly Property
Password Object
Definition and Usage
The readOnly property sets or returns whether the password field is read-only.
A read-only field cannot be modified. However, the user can select it and copy the text.
Syntax
Set the readOnly property:
passwordObject.readOnly=true|false
Return the readOnly property:
passwordObject.readOnly
Browser support





All major browsers support the readOnly property
Example
Example
The following example sets the password field to read-only:
Try it »
Password Object