Bug Tracker

Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#1090 closed bug (duplicate)

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:_.-]*

Change History (2)

comment:1 Changed 15 years ago by bcoverston

~ 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; <<

comment:2 Changed 15 years ago by john

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")
Note: See TracTickets for help on using tickets.