Skip to main content

Bug Tracker

Side navigation

#14532 closed bug (notabug)

Opened November 11, 2013 11:19PM UTC

Closed December 06, 2013 05:44PM UTC

ID selector fail with ':' in the id

Reported by: darrenrh@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:
Description

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.

http://jsfiddle.net/Ax3rP/4/

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

Attachments (0)
Change History (1)

Changed December 06, 2013 05:44PM UTC by timmywil comment:1

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.

http://api.jquery.com/id-selector/