Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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)
- Host: GitHub
- URL: https://github.com/nv/placeholder.js
- Owner: NV
- License: mit
- Created: 2009-08-18T12:19:01.000Z (over 15 years ago)
- Default Branch: gh-pages
- Last Pushed: 2011-05-04T08:27:03.000Z (over 13 years ago)
- Last Synced: 2024-04-15T13:56:35.157Z (8 months ago)
- Language: JavaScript
- Homepage: http://nv.github.com/placeholder.js/
- Size: 163 KB
- Stars: 116
- Watchers: 6
- Forks: 31
- Open Issues: 1
-
Metadata Files:
- Readme: README.markdown
- License: MIT-LICENSE.txt
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).