Skip to main content

Bug Tracker

Side navigation

#9955 closed bug (worksforme)

Opened August 01, 2011 10:54PM UTC

Closed August 01, 2011 11:00PM UTC

Last modified August 01, 2011 11:46PM UTC

Attribute selector with innerHTML and quotes

Reported by: Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:

Having :

<p><span class="test">123</span></p>

in the document, these won't select it :


but this would :


The documentation says it should be quoted.

The working case does not match the documentation.

Both of these work :

$('p > span').filter('[innerHTML="123"]')

$('p > span').filter('[innerHTML=123]')

But both of these don't :

$('p > span.test').filter('[innerHTML="123"]')

$('p > span.test').filter('[innerHTML=123]')

Latest line used to work in jquery 1.4.2.

If innerHTML used for attribute selector is unsupported, please clearly state it in the documentation.

Attachments (0)
Change History (3)

Changed August 01, 2011 11:00PM UTC by rwaldron comment:1

component: unfiledattributes
priority: undecidedlow
resolution: → worksforme
status: newclosed

innerHTML is not an attribute; it was by coincidence that it ever worked

Changed August 01, 2011 11:44PM UTC by comment:2

By jove !

I bet i'm not the only one using it...

Changed August 01, 2011 11:46PM UTC by dmethvin comment:3

I don't think we need to add a specific mention for this in the docs. Since innerHTML is not an attribute, it was never valid even though it may have worked in the past.