Extending jQuery / Sizzle with shortcut selectors to the new html5 input types.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.markdown
html5-pseudo.jquery.js
html5-pseudo.jquery.min.js

README.markdown

HTML5 input pseudo selectors

Copyright (c) 2009, Mike Taylor, http://miketaylr.com

MIT Licensed: http://www.opensource.org/licenses/mit-license.php

Usage

$(':search').whatever(); OR $(':input:search').whatever() selects all <input type="search"> elements, etc.

Thanks to Paul Irish and Ben Alman for non-medicated feedback!

And thanks again to Paul Irish for making it loopier.

Unit Tests

http://miketaylr.com/test/qunit/html5pseudoselectors.html

Note:

Rather than function(elem){return type === "foo"} we use elem.getAttribute("foo") because unknown input types are treated as type=text.