Bug Tracker

Opened 8 years ago

Closed 8 years ago

#10164 closed bug (worksforme)

jQuery fails to grab an element by id if the id contains the "+" chars

Reported by: reda.abdi@… Owned by:
Priority: low Milestone: None
Component: selector Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:

Description

While jQuery fails to grab an element by id if the id contains the "+" chars, the document.getElementById() function works and grab the element.

Thanks

Change History (1)

comment:1 Changed 8 years ago by addyosmani

Component: unfiledselector
Priority: undecidedlow
Resolution: worksforme
Status: newclosed

As per our docs: 'If you wish to use any of the meta-characters ( such as !"#$%&'()*+,./:;<=>?@[\]`{|}~ ) as a literal part of a name, you must escape the character with two backslashes:
'. Please see below for a jsFiddle using + in a selector working fine using two backslashes: http://jsfiddle.net/6BdDZ/

Note: See TracTickets for help on using tickets.