Bug Tracker

Opened 13 years ago

Closed 13 years ago

#5805 closed bug (fixed)

Odd behavior when trying to select option elements with the "selected" attribute.

Reported by: supster Owned by: john
Priority: minor Milestone:
Component: selector Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:


In short, the problem is that the following two lines do not select the same elements, even though as far as I understand, they should.

$("select option[selected=selected]")

$("option[selected=selected]", $("select"))

The fist correctly matches option elements where the "selected" attribute has the value of "selected", whereas the second does not match *any* elements.

I also notice that the "[selected]" attribute does not actually match the element that has an attribute with the name of "selected", but rather is equivalent to the ":selected" selector. This is rather inconsistent and seems undocumented.

Change History (2)

comment:1 Changed 13 years ago by supster

These issues seem to be fixed in 1.4: http://jsfiddle.net/8hGDB/

comment:2 Changed 13 years ago by dmethvin

Resolution: fixed
Status: newclosed

I'll close the ticket since it's reported as fixed in 1.4.

Note: See TracTickets for help on using tickets.