Bug Tracker

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#989 closed bug (invalid)

#-starting IDs are not found in the page

Reported by: dialtone Owned by:
Priority: major Milestone: 1.1.2
Component: core Version: 1.1.1
Keywords: Cc:
Blocked by: Blocking:


$('<li id="#foo">hi</li>').appendTo("body"); $("##foo")

Doesn't find the just added li item.

Change History (3)

comment:1 Changed 16 years ago by aercolino

# is not a valid id starter: When defining fragment identifiers to be backward-compatible, only strings matching the pattern [A-Za-z][A-Za-z0-9:_.-]* should be used

see: http://www.w3.org/TR/html4/types.html#h-6.2

comment:2 Changed 16 years ago by john

Resolution: invalid
Status: newclosed

aercolino is correct. We only accept IDs that are valid both in HTML documents and for CSS selectors.

comment:3 in reply to:  2 Changed 16 years ago by aheimlich

Replying to john:

Just to clarify, this means that you should should not use #, ., or : in your IDs as they are a part of CSS selector syntax, so the pattern becomes this:

Note: See TracTickets for help on using tickets.