A jQuery plugin that enables HTML5's new placeholder attribute to work in all browsers.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
License.md
ReadMe.md
demo.html
placeholder.js
placeholder.min.js

ReadMe.md

#Place Holder jQuery Plugin

This plugin will enable html5 placeholder attribute work in all browsers.

To use just include the plugin file along with jQuery. Then in your dom.ready function select the input elements you want to use then call placeholder() on them.

(function($) {
    $(document).ready(function() {
        $("input[placeholder]").placeholder();
    });
})(jQuery);

Your input elements need to have the placeholder attribute on them.

<input type="text" name="first-name" id="first-name" placeholder="John" />

##Feature Plans

Some sort of feature detection in order to let browsers who support placeholder work natively.

##About

Originally inspired by @robertbanh's post on Forrst. You can also find the code on github.

Also thanks to @ejetzer for suggesting a better way of selecting placeholder input elements.