jQuery HTML5 placeholder plugin

1 min read

Deviation Actions

thehappybit's avatar
By
Published:
0 Comments
672 Views
thehappybit.com/2012/02/jquery…

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 for free from GITHUB
© 2012 - 2021 thehappybit
Comments0
Join the community to add your comment. Already a deviant? Log In