Skip to main content

Bug Tracker

Side navigation

#11837 closed bug (invalid)

Opened May 30, 2012 06:58AM UTC

Closed May 30, 2012 10:24AM UTC

selector not working for long ids

Reported by: reuben@e-jaz.com.au Owned by:
Priority: low Milestone: None
Component: selector Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

I have a long div id and jquery dosn't select it but good old getDocumentById does.

proof: http://jsfiddle.net/FnMxV/1/

firefox 12 (firebug)

IE 9

All jQuery versions on jsFiddle fail this

Attachments (0)
Change History (1)

Changed May 30, 2012 10:24AM UTC by sindresorhus comment:1

component: unfiledselector
priority: undecidedlow
resolution: → invalid
status: newclosed

It chokes on the =

From the jQuery selectors 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: \\\\. For example, if you have an element with id="foo.bar", you can use the selector $("#foo\\\\.bar"). The W3C CSS specification contains the complete set of rules regarding valid CSS selectors. Also useful is the blog entry by Mathias Bynens on CSS character escape sequences for identifiers.

If you escape the = with \\\\ it works.