This project is read-only.
Project Description
A very simple plugin for jQuery for being able to use HTML5 placeholder attribute (for input fields) in browsers that doesn't support it.


How to use?
Just include the following files in your html and it should work.
  • jquery.html5.placeholder.css
  • jquery.html5.placeholder.js or minified version jquery.html5.placeholder.min.js


How does it work?
If the browser already supports placeholder attribute the plugin does nothing.
Otherwise, it binds to focus and blur events for all <input placeholder="..." /> fields and
  • set/unset the field value with placeholder
  • Add/Remove .html5-placeholder css class (declared in jquery.html5.placeholder.css)
It also removes placeholder from field value on form submit to prevent sending those values.


Useful Links
About HTML5 Placeholder Attribute: http://diveintohtml5.org/forms.html#placeholder
jQuery: http://jquery.com

Last edited Aug 20, 2010 at 1:45 AM by CiprianG, version 14