Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Support certain HTML 5 attributes with javascript, but only if the browser doesn't already support them.

branch: jquery14

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 test
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 html5support.js
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.

Example

HTML

<input type=“text” autofocus /> <input type=“text” placeholder=“Search Here” name=“q” />

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/” />

Something went wrong with that request. Please try again.