jQuery HTML5 placeholder plugin

in Javascript

The plugin adds cross-browser support for the HTML5 placeholder attribute functionality.

Usage

In order for the plugin to work, insert the following code inside your $(document).ready function:

$.placeholder();

Customization

The plugin comes with two customization options:

$.placeholder({
	'className': 'placeholder',
	'attrName': 'placeholder'
});
  • The className parameter lets you pick the class which is toggled on the input element that has the placeholder attribute specified.
  • The attrName parameter lets you choose which attribute to look for. For instance, you could make use of the placeholder functionality using an attribute different than placeholder, eg. data-placeholder.

Download from Github

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>