HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Textarea Object : 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.
Property | |||||
---|---|---|---|---|---|
placeholder | Yes | 10.0 | Yes | Yes | Yes |
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:
var x = document.getElementById("myTextarea").placeholder;
HTML reference: HTML <textarea> placeholder attribute
❮ Textarea Object