The HTML5 Placeholder Plugin simulates placeholder functionality for inputs and textareas, which is particularly handy in browsers that still need some work.
A MIGHTYminnow plugin.
- No setup necessary, works immediately after installing
- Super lightweight, less than 3kb minified jQuery
- Automatically detects for placeholder support – no need for extra feature detection like Modernizr
- Based on Mathias Bynens’ widely popular and well tested polyfill – thanks Mathias!
How to use
This plugin creates and uses a placeholder() jQuery function, and invokes it for inputs and textareas. This happens automatically as soon as you install it. If for some crazy reason you would like to invoke it on other elements aside from inputs and textareas, you can do so with you own jQuery, like so:
- How does this plugin work?
This plugin implements an elegant jQuery script written by Mathias Bynens to simulate proper placeholder functionality in browsers that don’t natively support it. The current version of the plugin is based on the following version of Mathias’ code: https://github.com/mathiasbynens/jquery-placeholder/blob/fdd8d253edc8708fbe5d3ecf9a17a919713a3733/jquery.placeholder.js. It may be updated in the future if any improvements are made on his end.
- I need to modify the plugin behavior, what should I do?
- Write to me with your request/suggestion – maybe the plugin should be improved for all.
- If you’d rather have at it yourself, more power to you. The plugin utilizes jQuery that has been minified (html5-placeholder-polyfill.min.js), but the unminified version is also included (html5-placeholder-polyfill.js). You can tinker with the unminified version, minify it, and copy it into html5-placeholder-polyfill.min.js.
* Functionality added to admin and login screen.
* Added support for SCRIPT_DEBUG (non-minified jQuery is included if SCRIPT_DEBUG is set to true).
- Removed extra blank lines at end of main php file causing the following error: “The plugin generated 2 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.”
- Switching to non-beta version number
- First release