Skip to main content

jQuery Placeholder Plugin Released

·1 min

The jQuery Placeholder Plugin provides support for the placeholder HTML5 attribute in browsers that do not support it.

To use it, include the JS and CSS in your page and do the following:

<input placeholder="Some placeholding text" type="text"></input>

In browsers that support the placeholder attribute (currently Firefox 3.7+, Chrome 4.0+ and Safari 4.0+), the plugin will do nothing, letting the browser render it natively. In browsers that do not support it, the plugin will emulate support using JavaScript.

Thats all it does. I use this plugin wherever I wan’t to use some placeholder text (including this site, in the search box).

For more information, see the plugins home page. The code is available on GitHub and is released under the MIT License.