Input Email placeholder Property
Examples
Modify the hint text for the expected value of the email field:
document.getElementById("myEmail").placeholder = "Your Email
address";
Try it Yourself »
Definition and Usage
The placeholder property is used to set or return the value of the placeholder attribute of the email field.
The placeholder attribute provides a hint that describes the expected value of the input field.
This hint is displayed when the input field is empty and disappears when the field gains focus.
Browser Support
![]()
All major browsers support the placeholder attribute.
Note:Internet Explorer 9 and earlier IE versions do not support the placeholder attribute.
Syntax
Return the placeholder property:
emailObject.placeholder
Set the placeholder property:
emailObject.placeholder=text
Property Values
| Value | Description |
|---|---|
| text | A hint that describes the expected value of the input field |
Technical Details
| Return Value: | A string representing a hint that describes the expected value of the input field |
|---|
More Examples
Example
Get the expected value hint of the email field:
var x = document.getElementById("myEmail").placeholder;
xThe output result is:
Email
Try it Yourself »
Related Pages
HTML Reference Manual:HTML <input> placeholder Attribute
Other Extensions
Input Email Object