Bug Tracker

Opened 11 years ago

Closed 11 years ago

#4139 closed bug (invalid)

Selector failing on classes starting with ampersand

Reported by: hjaven Owned by: john
Priority: minor Milestone: 1.3.2
Component: selector Version: 1.3.1
Keywords: selector Cc:
Blocked by: Blocking:

Description

Selector fails on classes containing ampersand which is a leagal character according to

http://www.w3.org/TR/CSS2/syndata.html

Attachments (1)

ampersand.htm (1.3 KB) - added by hjaven 11 years ago.
Showing selector failing on classnames containing ampersand

Download all attachments as: .zip

Change History (2)

Changed 11 years ago by hjaven

Attachment: ampersand.htm added

Showing selector failing on classnames containing ampersand

comment:1 Changed 11 years ago by dmethvin

Resolution: invalid
Status: newclosed

Thanks for the test case. You just need to escape the char:

  alert("Matches =" + $(".my\\&Class").length); 
  alert("Matches =" + $(".\\&myClass").length); 

See the note at the bottom of this page:

http://docs.jquery.com/Selectors

Note: See TracTickets for help on using tickets.