Quantcast

msie doesn't like ordered lists in innerHTML

$tinkle

Expert on blowing
Feb 12, 2003
14,591
5
if i have:
Code:
elt1.innerHTML = "<ol style='list-style-type: disc;'>";
elt2.innerHTML = "<li>red</li>";
elt3.innerHTML = "<li>green</li>";
elt4.innerHTML = "<li>blue</li></ol>";
FF plays nice & displays a bulleted ordered list, but [all versions of] msie issues an unknown runtime exception. this seems to be unique to ordered lists, as other tags behave in all browsers:
Code:
"<span style='font-weight:bold; font-style: italic;'>Selecting the Login button is the acceptance of the Privacy Act Notification.</span>"
i even tried putting my <ol> in a div, span, or p tags, & was unsuccessful

i'm about to start getting my CDATA on, but don't have those chops
 

$tinkle

Expert on blowing
Feb 12, 2003
14,591
5
Try it nao?
after making a few adjustments, i did.

first, my validation:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
then, i had this to fix (see prev post for code which assigns labels):
Code:
<p><label id="termsOfUseP1Id"></label></p>
<p><label id="termsOfUseP2Id"></label></p>
<p><label id="termsOfUseP3Id"></label></p>
<p><label id="termsOfUseP4Id"></label></p>
which even a jr web developer should know is a huge no-no when you try & stick ordered lists inside concurrent <p> tags

the fix? just removed all the <p> tags & all is well.