![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML
The placeholder attribute of the <textarea> element is used to set a placeholder text in the textarea. A placeholder is considered as a hint, like “Enter you name”, “Enter mobile number”, “Write in 100 words”, etc.
Following is the syntax−
<textarea placeholder="text">
Above, text is the hint you want to set for the textarea as a placeholder text.
Let us now see an example to implement the placeholder attribute of the <textarea> element−
Example
<!DOCTYPE html> <html> <body> <h2>Interview Questions</h2> <p>Q1</p> <textarea rows="6" cols="70" placeholder="Why do you want go for the Editor Job Profile? (100 words)"> </textarea> <p>Q2</p> <textarea rows="6" cols="70" placeholder="Do you have any previous publishing experience? (100 words)"> </textarea> </body> </html>
Output
In the above example, we have set two textarea−
<p>Q1</p> <textarea rows="6" cols="70" placeholder="Why do you want go for the Editor Job Profile? (100 words)"> </textarea> <p>Q2</p> <textarea rows="6" cols="70" placeholder="Do you have any previous publishing experience? (100 words)"> </textarea>
To display a placeholder text, the placeholder attribute is used, for example−
placeholder="Why do you want go for the Editor Job Profile? (100 words)"
Advertisements