HTML5 has introduced many features to the browser; some that can be used with form elements.One of these is the
placeholderattribute to INPUT elements. The
All you need to do is add a
placeholder attribute with the text of your choice.
<input type=”text” name=”first_name” placeholder=”Your first name…”> View Demo
If you are interested in taking advantage of the new placeholder attribute. One thing to ensure is that older browsers function similarly to ensure consistency and proper user experience. So check for Placeholder Support first then do the fallback to older browsers, and ensure default values are not submitted in those older browsers.