Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/nv/placeholder.js

Brings HTML5 placeholder attribute into all modern browsers (not maintained any more)
https://github.com/nv/placeholder.js

Last synced: about 2 months ago
JSON representation

Brings HTML5 placeholder attribute into all modern browsers (not maintained any more)

Awesome Lists containing this project

README

        

placeholder.js — bring HTML 5 placeholder attribute to all browsers
===================================================================

placeholder.js is not maintained any more. Use one of those:

* [mathiasbynens/Placeholder-jQuery-Plugin](https://github.com/mathiasbynens/Placeholder-jQuery-Plugin)
* [danielstocks/jQuery-Placeholder](https://github.com/danielstocks/jQuery-Placeholder)

[![placeholder](http://nv.github.com/placeholder.js/example.png)](http://nv.github.com/placeholder.js/)

The placeholder attribute is the part of [HTML5 specification](http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#attr-input-placeholder).
Currently, it works only in WebKit-based browsers, like Google Chrome and Safari.
Placeholder.js fixes it!

Tested on IE 6—8, Firefox 3.5, Safari 4—5, Google Chrome 3—6, Opera 9.5—10.6.

## [jquery.textPlaceholder.js](http://nv.github.com/placeholder.js/jquery.textPlaceholder.js)

CSS: `.text-placeholder {color: #AAA !important}`
JS: `$("[placeholder]").textPlaceholder();`

[An example](http://nv.github.com/placeholder.js/tests/jquery/textarea.html).

## [placeholder.js](http://nv.github.com/placeholder.js/placeholder.js) (pure JS version)

JS: `inputPlaceholder(document.getElementById('some_input'), "#AAA")`

[An example](http://nv.github.com/placeholder.js/tests/textarea.html).

## Limitations

placeholder.js doesn't work with `` in IE (at least in IE ≤ 9).