Cross-browser support for input element placeholders
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.
README.md
demo.html
jquery.placeholders.js

README.md

jQuery Input Placeholders

A jQuery plugin to add placeholders to form input elements. Webkit provides these functionality natively, this plugin adds this to all browsers.

If you want placeholders that don't disappear on focus, you might want to checkout my Inline Labels Plugin instead.

Usage instructions

Add this to the HEAD of the document (after you include jQuery, of course):

<script src="jquery.placeholders.js" type="text/javascript" charset="utf-8"></script>

Just add the placeholder to inputs and the plugin will autoload if needed, depending on browser support. If you need to manually activate the plugin on specific elements that you dynamically add to the DOM, just call $('el').placeholders().

See demo.html for an example.

Credits

Written by Mark Dodwell (@madeofcode)

Bitdeli Badge