Super simple crossbrowser Placholder support fro inputs and textareas.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Demo
Docs
Source
README.md
package.yml
screenshot.png

README.md

PlaceholderSupport

Adds a fallback for browsers that do not support the placeholder attribute.
Probably the most simple solution for this out there.
I found many others where you need extra CSS. This is so simple that you just have to call the class and you have placeholder support for all browsers!

Published under the MIT-License.

Screenshot

How to use

Just add the PlaceholderSupport.js to your website and call:

#JS
window.addEvent('domready',function(){

  new PlaceholderSupport();

});

Will add placeholder functionality to all inputs and textarea elements with a "placeholder" attribute.

#JS
window.addEvent('domready',function(){

  new PlaceholderSupport('input.myInputWithPlaceholder');

});

Will add the placeholder only to inputs with the class "myInputWithPlaceholder". But this input needs also a placeholder attribute with a text!