<style>
/* these style declarations are optional */
b{
display:block;
font-weight:normal;
}
</style>
</head>
<body onload="init();">
<!-- these two DOM trees will be loaded differently, because the first div has its
contents set with Javascript through innerHTML, while the second doesn't.
-->
<b><b><b>
<div id="msg"></div>
</b></b></b>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" www.w3. org/TR/ html4/strict. dtd"> /bugzilla. mozilla. org/show_ bug.cgi? id=381808
"http://
<html>
<!--
this page doesn't validate; w3c doesn't think you can nest <b> tags. Not sure what the expected behavior should be.
Filed as: https:/
-->
<head>
<script type="text/ javascript" > getElementById( "msg"). innerHTML= "section 1";
function init(){
document.
/* produces the DOM tree (use firebug to inspect):
<b><b><b>
<div id="msg">
<b><b><b>section 1</b></b></b>
</div>
</b></b></b>
instead of the expected:
<b><b><b>
<div id="msg">
section 1
</div>
</b></b></b>
*/
}
</script>
<style> normal;
/* these style declarations are optional */
b{
display:block;
font-weight:
}
</style>
</head>
<body onload="init();">
<!-- these two DOM trees will be loaded differently, because the first div has its
contents set with Javascript through innerHTML, while the second doesn't.
-->
<b><b><b>
<div id="msg"></div>
</b></b></b>
<b><b><b>
<div id="msg2">section 2</div>
</b></b></b>
</body>