Skip to main content

Bug Tracker

Side navigation

#1090 closed bug (duplicate)

Opened March 30, 2007 08:43PM UTC

Closed April 06, 2007 05:45PM UTC

Last modified June 21, 2007 04:20AM UTC

ID attributes do not match all valid NMTOKENs defined by HTML4

Reported by: bcoverston Owned by:
Priority: major Milestone: 1.1.3
Component: core Version: 1.1.2
Keywords: XHTML, IDs Cc:
Blocked by: Blocking:
Description

an ID of "foo:bar:baz" would fail to match because of the :

The valid set of NMTOKENS is defined by the following regex:

[A-Za-z][A-Za-z0-9:_.-]*

Attachments (0)
Change History (2)

Changed April 01, 2007 09:53PM UTC by bcoverston comment:1

~ ln 952 of 1.2.x

remove >>

var re2 = /^([a-z0-9_-]+)(#)([a-z0-9\\*_-]*)/i;

<<

replace with >>

var re2 = /^([a-z0-9_-]+)(#)([a-z0-9\\*:_.-]*)/i;

<<

Changed April 06, 2007 05:45PM UTC by john comment:2

component: ajaxcore
resolution: → duplicate
status: newclosed

This has already been discussed here in ticket #143. CSS selectors don't support those characters for selection (since they're used elsewhere). However, CSS does allow you to use a backslash to escape characters. In the SVN version of jQuery you can now escape characters in IDs, for example:

$("#foo\\:bar")