#9132 closed feature (wontfix)
Add pseudo selectors for new HTML5 input types e.g. :email, :search, etc.
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.7 |
Component: | selector | Version: | 1.6 |
Keywords: | 1.7-discuss | Cc: | |
Blocked by: | Blocking: |
Description
We already have :text. For consistency we should add :email, :url, and :search
Change History (15)
comment:1 Changed 12 years ago by
Component: | unfiled → selector |
---|---|
Priority: | undecided → low |
Type: | enhancement → feature |
comment:3 Changed 12 years ago by
Status: | new → open |
---|
For now you can also do $('input[type="email"]'), but IE converts types it doesn't understand to text, which makes a filter like more troublesome.
comment:5 Changed 12 years ago by
-1, These can easily be created as custom selectors: http://jsfiddle.net/rwaldron/W7PS4/
comment:7 Changed 12 years ago by
-1, plugin, if needed. and there's the question of should it fall back to text if not supported or not return anything?
comment:8 Changed 12 years ago by
+1, We should also decide if :text should return type=email on older browsers. To new programmers who started with HTML5 that behavior is just as confusing. We should just add to the docs that that :text may return other input elements on older browsers.
In my opinion, if we have one of these filters built in we should have all of them. True, they can be easily added with a plug-in or a custom selector, but so could :text and we have that. This kind-of basic functionality is useful and should be built-in. While its behavior is weird on older browsers, that is already true for :text and can be documented.
comment:9 Changed 12 years ago by
-1, without also detecting browser support for each input type, you're probably going to make the wrong choice.
comment:10 Changed 12 years ago by
-1, Read my lips, no new selectors. For consistency, Sizzle should select only text inputs with [type=text]
and select only email elements for [type=email]
comment:13 Changed 12 years ago by
-1, I understand adamzr's reply, but as Dave and John indicate above, we are very resistant to add custom selectors because they force us to take slow paths and general create a number of other headaches. We can't drop the existing selectors, which have existed obviously since before these HTML5 elements were really kicking around - but that alone does not mean we are realistically able or want to continue adding more.
comment:14 Changed 12 years ago by
+0, <3 custom selectors, but I understand that these aren't going to land...
comment:15 Changed 12 years ago by
Milestone: | 1.next → 1.7 |
---|---|
Resolution: | → wontfix |
Status: | open → closed |
Closing per 1.7 roadmap meeting resolution
http://blogs.sitepoint.com/make-your-own-custom-jquery-selector/
I don't think this belongs in the core, at least until/unless we have html5 shim suppot