Support certain HTML 5 attributes with javascript, but only if the browser doesn't already support them.
JavaScript CSS
Latest commit 30a3512 Jun 16, 2014 @amiel Merge pull request #10 from goofballLogic/master
fixed the minified unicode character encoding
Failed to load latest commit information.
test Merge branch 'master' of github.com:amiel/html5support Feb 29, 2012
MIT-LICENSE.txt add Carnes Media to the copyright notice Feb 7, 2011
README.rdoc
jquery.html5support.js Always clear placeholder class when focus is gained. Jun 11, 2013
jquery.html5support.min.js fixed the minified unicode character encoding Jun 11, 2014

README.rdoc

HTML5 Support

The aim of HTML5 is to seamlessly provide support an extremely lightweight plugin for a few commonly used html5 attributes for browsers that don't already support them.

HTML5 Support currently supports the placeholder attribute and the autofocus attribute. HTML5 Also supports type=“password” fields, by special casing them, and swapping elements.

Example

HTML

<input type="text" autofocus />
<input type="text" placeholder="Search Here" name="q" />
<input type="password" placeholder="Password" name="pass" />

jQuery

$(document).ready(function() {
  $.html5support();

  // or you can also run only support for what you want
  $.placeholder();
  // - or -
  $.autofocus();
});

CSS

Use this CSS if you would like your placeholder text to show up grey in browsers that do not natively support placeholder.

.placeholder{ color: #888; }

TODO

Support could be added for more HTML5 features. Ideas:

  • <input pattern=“/regex/” />

License

HTML5 Support is licensed under the MIT License. See the MIT-License.txt file for full details.