Bug Tracker


Ticket #9955 (closed bug: worksforme)

Opened 3 years ago

Last modified 3 years ago

Attribute selector with innerHTML and quotes

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


Having : <p><span class="test">123</span></p> in the document, these won't select it : $('span[innerHTML="123"]') but this would : $('span[innerHTML=123]') 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.

Change History

comment:1 Changed 3 years ago by rwaldron

  • Priority changed from undecided to low
  • Resolution set to worksforme
  • Status changed from new to closed
  • Component changed from unfiled to attributes

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

comment:2 Changed 3 years ago by kapouer@…

By jove !

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

comment:3 Changed 3 years ago by dmethvin

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Add a comment

Modify Ticket

as closed

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.