#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: |
Description
$('<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
comment:2 follow-up: 3 Changed 16 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
aercolino is correct. We only accept IDs that are valid both in HTML documents and for CSS selectors.
comment:3 Changed 16 years ago by
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:
[A-Za-z][A-Za-z0-9_-]*
Note: See
TracTickets for help on using
tickets.
# 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