- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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 placeholder Attribute
The HTML placeholder attribute represents the text that is displayed in the input/textarea element before the user begin entering anything.
Syntax
Following is the syntax −
<tagname placeholder=”text”></tagname>
Let us see an example of HTML placeholder Attribute −
Example
<!DOCTYPE html> <html> <style> body { color: #000; height: 100vh; background-color: #8BC6EC; background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%); text-align: center; } </style> <body> <h1>HTML placeholder Demo</h1> <input type="text" placeholder='Enter your first name'> <input type="text" placeholder='Enter your last name'> </body> </html>
Output
- Related Articles
- HTML placeholder Attribute
- HTML placeholder Attribute
- How to use placeholder attribute in HTML?
- HTML DOM Textarea placeholder Property
- HTML DOM Input Number placeholder Property
- HTML DOM Input Password placeholder property
- HTML DOM Input Email placeholder Property
- HTML DOM Input URL placeholder Property
- HTML DOM Input Search placeholder property
- HTML DOM Input Text placeholder property
- How to change the color of the placeholder attribute with CSS?
- HTML pattern Attribute
- HTML novalidate Attribute
- HTML maxlength Attribute
- HTML wrap Attribute

Advertisements