Bug Tracker

Opened 12 years ago

Closed 12 years ago

#9569 closed bug (invalid)

Problem with space-separated attribute selector

Reported by: anonymous Owned by:
Priority: low Milestone: 1.next
Component: selector Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:

Description

When using the $ selector for a single attribute, like : $("span[myAttribute1='data']"), it works. when attempting a 2 attribute selector, like so: $("span[myAttribute1='data'][myAttribute2='data2']") it also works.

However, when trying the same selector, with a space between the 2 attributes, it does not find the nodes. $("span[myAttribute1='data'] [myAttribute2='data2']")

Change History (2)

comment:1 Changed 12 years ago by anonymous

i think that the space are used to identify the nested elements...

for example:

$("span[myAttribute1='data'].myspan") and $("span[myAttribute1='data'] .myspan") are different...

because:

  • the second search any elements into "span[myAttribute1='data']" with class "myspan";
  • the first search any "span[myAttribute1='data']" with class "myspan".

it shouldn't be an error...i think...

comment:2 Changed 12 years ago by Timmy Willison

Component: unfiledselector
Priority: undecidedlow
Resolution: invalid
Status: newclosed

anonymous is right

Note: See TracTickets for help on using tickets.