Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Latest commit

 

History

History
31 lines (22 loc) · 971 Bytes

README.md

File metadata and controls

31 lines (22 loc) · 971 Bytes

#jQuery placeholder

A very simple jQuery plugin to enable HTML5 placeholder attribute support to older web browsers.

##Usage

Utilizing the Modernizr library you can detect support for the placeholder attribute and initialize the plugin.

    $(document).ready(function() {
        if(!Modernizr.input.placeholder) {
            $(document).Placeholder({ defaultClass: "dtext" });
        }
    });

##Initialization Options

defaultClass

This is the name of the class that will be applied to any element the plugin has control over. It will allow you to style the default placeholder text according to your needs. The demo just uses grey italic as this seems to be the behavior most browsers with placeholder support seem to do. Example:

            .dtext {
                font-weight: normal;
                font-style: italic;
                color: grey;
            }