[thelist] IE LI UL DOM problem

Chris Heilmann lists at onlinetools.org
Mon Nov 29 11:39:19 CST 2004


> Woho, I managed to cram in lots of acronyms in the subject.
> Seriously though, I have list like this
>
> <ul>
> <li id="1">text</li>
> <ul id="2">
> <li>next level</li>
> </ul>
> <li id="3">first level again</li>
> </ul>
>
> Now, opera and FF gladly goes along with considering 1 and 2 as siblings
> when traversing the DOM, however, IE does not recognice the ul (id==2)
> at all, like it wasn't there. I've tried 1.nextSibling and gotten 3
> rather than 2 (hope you follow my non-javascript quicky code here)
> Have I just missed the solution to this problem somewhere? Seems like a
> major bug IMHO.
> Help very much appreciated or I'll have to come up with a nasty solution
> of sorts to hack around it.
> (and I don't think it's my codes fault, since the page works as it
> should in both opera and ff)

Easy, 1 and 2 are invalid IDs
http://www.w3.org/TR/REC-html40/types.html#type-id
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed
by any number of letters, digits ([0-9]), hyphens ("-"), underscores
("_"), colons (":"), and periods (".").


-- 
Chris Heilmann
http://icant.co.uk/ | http://www.onlinetools.org/



More information about the thelist mailing list