The Placeholder Arribute in HTML5

Introduction: The placeholder attribute is used for providing hint to the user during form entry. Placeholder text is appeared in input field and it disappeared when corresponding field get focus. Now we use to placeholder attribute. Its syntax is given below.

<input type="type" name="name" placeholder="Hint Text" >

We write the following code

<!DOCTYPE HTML>
<html>
<body>
<form method="get">
First Name<input type="text" name="fname" placeholder="Your First Name" /><br/>
Last Name<input type="text" name="lname" placeholder="Your Last Name"/><br/>
Email <input type="email" name="EMail" placeholder="Your email id"/><br/>
<input type="submit" />
</form>
</body>
</html>

Then we run this code. The output will look like as below

placeholder arrtibute 

Ebook Download
View all
Learn
View all