![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
How to use placeholder attribute in HTML?
If you want to set a hint for text area or input field, then use the HTML placeholder attribute. The hint is the expected value, which gets displayed before the user enters a value, for example, name, details, etc.
Example
You can try to run the following code to learn how to use placeholder attribute in HTML.
<!DOCTYPE html> <html> <body> <h2>Register</h2> <form action="/new.php"> <input type="text" placeholder="Student UserName" name="name"/><br> <input type="password" placeholder="Password" name="password"> <br><br> <input type="submit" value="Submit"> </form> </body> </html>
Advertisements