Placeholder Form Field Input Attribute Tutorial

Published :
Author :
Adam Khoury
Learn to apply the placeholder attribute to your HTML web form input fields. The placeholder input attribute populates the target text field with lightly colored instructions to the user that disappear when the user begins typing, and reappear if the user removes all text from that field. This can save real estate in your web applications if you do away with your form labels. The placeholder text can serve as labels or instructions for the field. <!DOCTYPE html> <html> <head> </head> <body> <h2>Form Input Placeholder Example</h2> <input type="text" name="fname" id="fname" placeholder="Type first name here"> <br><br> <input type="text" name="lname" id="lname" placeholder="Type last name here"> </body> </html>