HTML DOM Input Email readOnly property
Examples
Email field is set to read-only:
. Document.getElementById ( "myEmail") readOnly = true;
Output:
try it"
Definition and Usage
readOnly property sets or returns the email field is read-only.
Read-only fields can not be modified. But you can copy the contents of the field.
This property reflects the HTML readonly attribute.
Tip: To ensure the accuracy of the form data, you can use the disabled property instead.
Browser Support
All major browsers support readOnly property.
Note: Internet Explorer 9 (and earlier versions of IE), or Safari browser does not support type = "email" in the HTML <input> elements.
grammar
Back readOnly attributes:
emailObject .readOnly
Set readOnly properties:
emailObject .readOnly = true | false
Property Value
value | description |
---|---|
true | false | Describes the email field is read-only
|
technical details
return value: | Boolean value that, if the email field is read-only returns true, otherwise returns false. |
---|
More examples
Examples
Check email field is read-only:
var x = document.getElementById ( "myEmail") readOnly.;
x The output is: true
try it"
Related Pages
HTML Reference Manual: HTML <the INPUT> Readonly property
Input Email Object