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

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

License

Notifications You must be signed in to change notification settings

BlakeGardner/jquery-placeholder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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;
            }

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published