Dofactory.com
Dofactory.com

HTML <textarea> placeholder Attribute

The placeholder attribute adds a hint to a <textarea> element.

The hint appears as muted text inside the control and specifies what data to enter.

Example

#

A placeholder attribute on a <textarea> element.
The placeholder specifies the data the textarea expects.

<textarea rows="5" cols="75" placeholder="Please enter your feedback">
</textarea>

Using placeholder

The placeholder attribute adds a hint to the textarea.

The hint appears as muted text inside the control. It disappears when the user starts entering data.


Syntax

<textarea placeholder="text">

Values

#

Value Description
text String value. The hint text.

Browser support

Here is when placeholder support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <textarea>

Author: Jack Poorte
Published: Jun 20 2021
Last Reviewed: Sep 30 2023


Quick question: what's your favorite/least favorite part of Dofactory?


Guides