Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A plugin that enables HTML5 placeholder support for legacy browsers

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 tests
Octocat-spinner-32 README.rst
Octocat-spinner-32 demo.html
Octocat-spinner-32 jquery.placeholder.js
Octocat-spinner-32 jquery.placeholder.min.js

jQuery Placeholder Newlines

jQuery Placeholder Newlines is a fork of the jQuery-Placeholder plugin but with support for newlines.

Since no browsers support this, we active the plugin for all browsers, not just legacy browsers.

TODO: Add Webkit implementation: Webkit leaves placeholder visible until there is text in the textarea where as most browsers hide the placeholder on focus.

Placeholder plugin for jQuery

A jQuery plugin that enables HTML5 placeholder support for legacy browsers

The HTML5 placeholder attribute is awesome, unfortunately only supported by some browsers. This plugin replicates the placeholder behavior for unsupported browsers.


IE 6+ Firefox 3+ Safari 3+ Chrome ✓ Opera ✓ iPhone ✓ Android ✓

Please note The placeholder attribute should not be used as an alternative to a label.

If you must hide labels, do it with JavaScript as you activate the placeholder.


It's easy!:

$('input[placeholder], textarea[placeholder]').placeholder();



Native styling of HTML5 placeholders:

::-webkit-input-placeholder {color: red;}

:-moz-placeholder {color: red;}

jQuery-Placeholder toggles a .placeholder class for browser that don't natively support placeholders:

.placeholder { color: red }


Copyright 2011, Daniel Stocks ( )

Thanks to Nikita Vasilyev and James Rosen for feedback and contribution.

Something went wrong with that request. Please try again.