Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A plugin to enable HTML5 input placeholder support in non-Webkit browsers.
JavaScript
branch: master

This branch is 4 commits ahead, 1 commit behind schustafa:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
jquery.placeholder.js
readme.textile

readme.textile

Right now the placeholder attribute is only supported by Webkit-based browsers, so I made a simple script to enable placeholder behavior in all the other browsers.

Just include the script and use it like so:

$(function() {
  $('input').placeholder();
});

Optionally, you can pass it a hex color if you want something other than the default:

$(function() {
  $('input').placeholder('#777777');
});

The plugin binds an event (submit.placeholder) to an input element’s form element to strip out the placeholder text on submit. You can remove it like so:

$('form').unbind('.placeholder');
Something went wrong with that request. Please try again.