Bug Tracker

Modify

Ticket #4139 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

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:
Blocking: Blocked by:

Description

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

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

Attachments

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

Change History

Changed 4 years ago by hjaven

Showing selector failing on classnames containing ampersand

comment:1 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

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

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

View

Add a comment

Modify Ticket

Action
as closed
Author


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

 
Note: See TracTickets for help on using tickets.