Bug Tracker

Opened 11 years ago

Closed 11 years ago

#11837 closed bug (invalid)

selector not working for long ids

Reported by: reuben@… Owned by:
Priority: low Milestone: None
Component: selector Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:


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

Change History (1)

comment:1 Changed 11 years ago by sindresorhus

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.

Note: See TracTickets for help on using tickets.