Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 855 Bytes

File metadata and controls

21 lines (13 loc) · 855 Bytes

jQuery HTML5 placeholder plugin

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

Usage

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