Skip to content

Instantly share code, notes, and snippets.

View elivz's full-sized avatar

Eli Van Zoeren elivz

View GitHub Profile
@ckimrie
ckimrie / jquery.simple-placeholder.min.js
Last active December 11, 2015 11:28
Handy plugin that takes a simpler approach to tackling placeholder attribute support in older browsers. If you have a lot of logic & validation occuring on form submit, existing plugins can struggle to behave themselves. Instead of attempting to simulate the placeholder text inline with the input like most plugins, this simply creates a text nod…
/**
* Simple Placeholder Fallback
*
* A simpler and more robust method for adding fallback input placeholder support for
* browsers that dont support the attribute. No value spoofing, hidden input creation
* or other crazy methods. Simply appends the placeholder text after the input as help
* text.
*
* Simple & works with even the craziest validation and form submission logic, which is where
* the other techniques struggle.