ginader / HTML5-placeholder-polyfill

Small and robust polyfill for the HTML5 placeholder attribut.
GNU General Public License v2.0
223 stars 85 forks source link

How does this differ from https://github.com/mathiasbynens/jquery-placeholder? #54

Closed builtbylane closed 11 years ago

builtbylane commented 11 years ago

How does this differ from https://github.com/mathiasbynens/jquery-placeholder?

I only ask because jquery-placeholder is conveniently available on cdnjs.com and so I am about to use that one.

Sorry if this is an obnoxious question, it's not meant to be.

Thanks

ginader commented 11 years ago

Hi @builtbylane :-) Don't worry — your question is perfectly valid! There's quite a few placeholder polyfills out there and they all kinda do the same thing. The main differences this implementation has are:

  1. the placeholders are accessible to Screenreader users {visibleToScreenreaders : true}
  2. the placeholders can behave like in i.e. Chrome where they only disappear when the user starts typing rather than on focus (which is also a neat accessibility/usability feature) {hideOnFocus : false}
  3. the way it nicely integrates with modernizr/yepnope so it doesn't has to be loaded at all when the Browser has native support

Hope it helps! :-)