Skip to main content

Bug Tracker

Side navigation

#12531 closed bug (duplicate)

Opened September 13, 2012 03:16PM UTC

Closed November 02, 2012 01:45AM UTC

Last modified November 27, 2012 05:37PM UTC

elem[attr] selector

Reported by: Owned by: rwaldron
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="<>">

And i have query

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

Now a - is array with one text node, nodeValue is "<>"

But, i expect array with TR node


Dmitry Minkin

Attachments (0)
Change History (9)

Changed September 13, 2012 04:25PM UTC by dmethvin comment:1

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.

Changed September 14, 2012 01:10AM UTC by dmethvin comment:2

status: newopen

Changed September 14, 2012 10:10PM UTC by 3ds comment:3

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

Changed September 15, 2012 05:48PM UTC by rwaldron comment:4

owner: → rwaldron
status: openassigned

Changed September 15, 2012 05:49PM UTC by rwaldron comment:5

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.

Changed September 15, 2012 07:07PM UTC by gibson042 comment:6

Isn't this a duplicate of #11290 ?

Changed September 15, 2012 09:39PM UTC by rwaldron comment:7

Related, but not a dup

Changed November 02, 2012 01:45AM UTC by dmethvin comment:8

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".

Changed November 27, 2012 05:37PM UTC by dmethvin comment:9

milestone: 1.9None