Change the placeholder text of a text area:
The placeholder property sets or returns the value of the placeholder attribute of a text area.
The placeholder attribute specifies a short hint that describes the expected value of a text area (e.g. a sample value or a short description of the expected format).
The hint is displayed in the text area when it is empty, and disappears when the field gets focus.
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 text area |
Return Value: | A String, representing a short hint that describes the expected value of the text area |
---|
Get the placeholder text of a text area:
The result of x will be:
HTML reference: HTML <textarea> placeholder attribute