An open API service indexing awesome lists of open source software.

https://github.com/milly/jquery_placeholder

HTML5 placeholder attribute enabler in old browsers.
https://github.com/milly/jquery_placeholder

Last synced: about 1 year ago
JSON representation

HTML5 placeholder attribute enabler in old browsers.

Awesome Lists containing this project

README

          

# jQuery Form Placeholder
[HTML5 `placeholder` attribute](http://www.w3.org/TR/html5/common-input-element-attributes.html#the-placeholder-attribute) enabler in old browsers.

## Requirements
* [jQuery](http://jquery.com) 1.3 or later

## Author
* Milly

## Lisence
* Creative Commons BY-SA

## Usage

Options:

* `enabled` {Boolean} - enabled placeholder (Default: auto)
* `elements` {String} - form elements selector (Default: ':text,:password,textarea')
* `attr` {String} - placehold message attribute (Default: 'placeholder')
* `color` {String} - placehold color (Default: 'silver')
* `cssClass` {String} - placehold class (Default: 'placeholder')
* `message` {String} - placehold message (Default: '')

HTML Example:




Script Example:

// Setup placeholder
$('form').placehold();
// Disable placeholder
$('form').placehold({enabled:false});
// Set placehold color and message
$(':text[name=email]').placehold({ color: '#ff8888', message: 'Your e-mail' });
// Set global options
$.fn.placehold.conf.color = '#ff8888';
// Get Placeholder instance, and clear placehold message
$('#email').data('placehold').clear();