Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#12531 closed bug (duplicate)

elem[attr] selector

Reported by: [email protected] Owned by: Rick Waldron
Priority: high Milestone: None
Component: core Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:



jQuery JavaScript Library v1.7.1

I have element

<tr target="contacts" key="<[email protected]…>">

And i have query

a = $("tr[key='<[email protected]…>']")

Now a - is array with one text node, nodeValue is "<[email protected]…>"

But, i expect array with TR node


--- Dmitry Minkin

Change History (9)

comment:1 Changed 10 years ago by dmethvin

Component: unfiledcore
Milestone: None1.9
Priority: undecidedhigh

This is running afoul of the "looks like HTML" rule, which sees the <> in the string and processes it like $(html) instead of $(selector). As of jQuery 1.9 we'll require any string processed by $(html) to *start* with a < character, otherwise it will be treated as a selector. For cases where you want leading text nodes there is already $.parseHTML() which needs documentation still.

comment:2 Changed 10 years ago by dmethvin

Status: newopen

comment:3 Changed 10 years ago by 3ds

I wrote a fix for this, the pull request can be found here:


comment:4 Changed 10 years ago by Rick Waldron

Owner: set to Rick Waldron
Status: openassigned

comment:5 Changed 10 years ago by Rick Waldron

I've got a much smaller patch for this, but there is still an outstanding issue to address. Unfortunately I have to leave and drive 4 hours to Boston so I'll update when it's complete.

comment:6 Changed 10 years ago by gibson042

Isn't this a duplicate of #11290 ?

comment:7 Changed 10 years ago by Rick Waldron

Related, but not a dup

comment:8 Changed 10 years ago by dmethvin

Resolution: duplicate
Status: assignedclosed

Duplicate of #11290.
Although this isn't an exact dup of #11290 it will be fixed when we simplify the "looks like HTML rule".

comment:9 Changed 10 years ago by dmethvin

Milestone: 1.9None
Note: See TracTickets for help on using tickets.