Skip to main content

Bug Tracker

Side navigation

#10164 closed bug (worksforme)

Opened August 30, 2011 07:35AM UTC

Closed August 30, 2011 10:34AM UTC

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

Reported by: reda.abdi@gmail.com 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

Attachments (0)
Change History (1)

Changed August 30, 2011 10:34AM UTC by addyosmani comment:1

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/