HTML5 placeholder Attribute
HTML5 has introduced many interesting and usefull features like semantic tags , javascipt API’s form, Audio, video and many more. among them one of my favorites is the placeholder attribute to INPUT elements. The placeholder attribute shows text in a field until the field is focused upon, then hides the text.
As we had created placeholders for textboxes using javascript but it had a many probelm. actually when we set the value attribute initially, but, as soon as the user deletes that text and clicks away, the input will be left blank again. The HTML5 placeholder attribute has solved this issues.
HTML5 placeholder code:
- <input type=“text” name=“employee_first_name” placeholder=“Employee first name…”>

Above in the html code I have used text of my choice that will be displayed in textbox design when page loaded. and also there will be no need of javascript to make it dynamic and effective.
Follow @phpzag
