Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A jQuery plugin to enable cross-browser usage of the HTML5 autofocus property.
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README
jquery.autofocus-min.js
jquery.autofocus.js

README

HTML5 autofocus plugin v0.2*
Copyright (c) 2009, Mike Taylor, http://miketaylr.com
MIT Licensed: http://www.opensource.org/licenses/mit-license.php

NOTE: As per the spec, only one element is permitted to have the
autofocus attribute, hence no .each()

http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#autofocusing-a-form-control

USAGE: $("[autofocus]").autofocus();

Thanks to paul_irish and temp01 for feedback and improvement suggestions.
Something went wrong with that request. Please try again.