The plugin adds cross-browser support for the HTML5 placeholder attribute functionality.
Please insert the following code inside your $(document).ready function:
$.placeholder();The plugin comes with two customization options:
$.placeholder({
'className': 'placeholder',
'attrName': 'placeholder'
});- The
classNameparameter lets you pick the class which is toggled on the input element that has theplaceholderattribute specified. - The
attrNameparameter lets you choose which attribute to look for. For instance, you could make use of the placeholder functionality using an attribute different thanplaceholder, eg.data-placeholder.