Monthly Archives: October 2012

Use JavaScript (using jQuery) to add support for HTML5 placeholder attribute in form fields

Some browsers do not support the placeholder attribute added in HTML5. This attribute is useful for field hinting such as input formats for dates, phone numbers, and the like. If you see text in the field below, your browser supports placeholder, if not, add the code below to mimic the behavior 😉

Example field:

JavaScript (jQuery) workaround: Continue reading