Bug Tracker

Opened 9 years ago

Closed 9 years ago

#14532 closed bug (notabug)

ID selector fail with ':' in the id

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:


IDs with ':' aren't found by the ID selector. Using HTML5 so IDs should be valid with a number first.

It works in Pure JS and in at least one other framework, Mootools 1.4.5.


Converting a small project from mootools 1.4.5 to jquery 1.10.2 and it caused me a lot of confusion

Change History (1)

comment:1 Changed 9 years ago by timmywil

Resolution: notabug
Status: newclosed

The colon must be escaped: http://jsfiddle.net/Ax3rP/6/.

Always escape selectors as if you were passing them to querySelectorAll, not getElementById. jQuery will normalize the selector for you and still use getElementbyId internally for performance.


Note: See TracTickets for help on using tickets.