Change the placeholder text of an email field:
The placeholder property sets or returns the value of the placeholder attribute of an email field.
The placeholder attribute specifies a short hint that describes the expected value of an email field (e.g. a sample value or a short description of the expected format).
The short hint is displayed in the text field before the user enters a value.
The placeholder property is supported in all major browsers.
Note: The placeholder property is not supported in Internet Explorer 9 and earlier versions.
Return the placeholder property:
Set the placeholder property:
Value | Description |
---|---|
text | Specifies a short hint (one word or a short phrase) that describes the expected value of the email field |
Return Value: | A String, representing a short hint that describes the expected value of the email field |
---|
Get the placeholder text of an email field:
The result of x will be:
HTML reference: HTML <input> placeholder attribute