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.
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 comment:1
resolution: | → notabug |
---|---|
status: | new → closed |
The colon must be escaped: http://jsfiddle.net/Ax3rP/6/.
Always escape selectors as if you were passing them to
querySelectorAll
, notgetElementById
. jQuery will normalize the selector for you and still usegetElementbyId
internally for performance.http://api.jquery.com/id-selector/