PlaceholderSupport 1.0

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.



Details

Author
Fabian Vogelsteller
Current version
1.0
GitHub
frozeman/PlaceholderSupport
Downloads
1115
Category
Forms
Tags
Report
GitHub Issues

Releases


Dependencies

  • _self_/_current_: core/1.3: [Class]

How to use

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

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

  new PlaceholderSupport();

});

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

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!


Discuss

A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.

Found a bug in this plugin? Please report it this repository's Github Issues.

blog comments powered by Disqus