Skip to content

ajcates/placeholder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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.

About

A jQuery plugin that enables HTML5's new placeholder attribute to work in all browsers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published