HTML textarea Tag placeholder Attribute Tutorial

In this section, we will learn what the placeholder attribute is and how to use it.

What is placeholder Attribute in HTML <textarea> Tag?

The placeholder attribute is used in an HTML <textarea> to give a hint that describes what users should put in the target field.

Basically, the value we set for this attribute is a hint that will help users to understand how to fill the target field.

Note: the value of the placeholder attribute is shown in gray color in the body of the textarea and will disappear the moment users start to insert data to that field.

HTML placeholder Attribute in <textarea> Tag Syntax:

<textarea placeholder = “hint comment”> </textarea>

<textarea> Tag placeholder Attribute Values

The placeholder attribute takes a hint text value which describes how the target <textarea> element should be filled.

Example: using placeholder attribute in HTML <textarea> tag

See the Pen using placeholder attribute in HTML <textarea> tag by Omid Dehghan (@odehghan) on CodePen.

Leave a Reply