Skip to main content

Bug Tracker

Side navigation

#8646 closed bug (worksforme)

Opened March 25, 2011 03:38PM UTC

Closed March 25, 2011 05:12PM UTC

Last modified April 03, 2011 08:24PM UTC

[type=select-one] selector is broken

Reported by: anonymous Owned by: anonymous
Priority: undecided Milestone: 1.next
Component: selector Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:
Description

In earlier versions of jquery, before 1.5.0, the following would return true for normal select-one elements:

$(select_element).is('[type=select-one]')

Since 1.5.0, including 1.5.1, this is broken. Note that I have verified that:

$(select_element).attr('type') == 'select-one'

Attachments (0)
Change History (4)

Changed March 25, 2011 03:43PM UTC by dmethvin comment:1

owner: → anonymous
status: newpending

Please quote the attribute since it contains special characters. If there are still problems, please provide a link to a test case in jsFiddle.

Changed March 25, 2011 05:12PM UTC by addyosmani comment:2

resolution: → worksforme
status: pendingclosed

As per dmethvin, this works fine when you quote the attribute (which we do mention as being necessary for special character use in our docs). Confirmed here http://jsfiddle.net/addyosmani/Ldjap/1/ as working.

Changed April 03, 2011 01:30PM UTC by hansengracea@gmail.com comment:3

Please reopen.

Even properly quoted selectors that include type="select-one" fail for <SELECT> elements. For example: $('select[type="select-one"]');

jsfiddle: http://jsfiddle.net/Ldjap/6/

Changed April 03, 2011 08:24PM UTC by rwaldron comment:4

component: unfiledselector

You're mistaking DOM properties with HTML element attributes

http://jsfiddle.net/rwaldron/DL3Df/1/