Skip to main content

Bug Tracker

Side navigation

#4139 closed bug (invalid)

Opened February 12, 2009 06:26PM UTC

Closed February 14, 2009 01:45AM UTC

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 February 12, 2009 06:27PM UTC.

    Showing selector failing on classnames containing ampersand

Change History (1)

Changed February 14, 2009 01:45AM UTC by dmethvin comment:1

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