Skip to content

A simple jQuery plugin that provides support for the HTML5 placeholder attribute in older browsers.

Notifications You must be signed in to change notification settings

alexrabarts/jquery-placeholderpatch

Repository files navigation

placeholderPatch: a jQuery plugin

placeholderPatch is a simple jQuery polyfill that provides support for the HTML5 placeholder attribute in older browsers.

Usage

The plugin is activated simply by including the file in the page. If you need to explicitly call the function on an element then you can do so:

  $('#myInput').placeholder();

You probably want to add a style to your placeholders:

  input.placeholder { color: #CCC; }

Customise the placeholder class applied to the input:

  $('#myInput').placeholder({placeholderClass: 'customPleaceholderClass'});

TODO

  • Keep label until text is entered in input
  • Support password inputs

Licensing

Licensed under the MIT: http://www.opensource.org/licenses/mit-license.php

Copyright (c) 2013 Alex Rabarts

About

A simple jQuery plugin that provides support for the HTML5 placeholder attribute in older browsers.

Resources

Stars

Watchers

Forks

Packages

No packages published