8. Placeholders
Before, we had to utilize a bit of JavaScript to create placeholders for textboxes. Sure, you can initially set the
value
attribute how you see fit, but, as soon as the user deletes that text and clicks away, the input will be left blank again. The
placeholder
attribute remedies this.
- <input name="email" type="email" placeholder="doug@givethesepeopleair.com" />
Again, support is shady at best across browsers, however, this will continue to improve with every new release. Besides, if the browser, like Firefox and Opera, don’t currently support the
placeholder
attribute, no harm done.
Comments
Post a Comment