<body>
<div id="outer">
<script>var e = document.createElement("div");
e.id = "inner1";
document.body.appendChild(e);</script>
<script>document.write("<div id='inner2'></div>");</script>
The structure I want would be: html>body>div#outer>div#inner1+div#inner2
the structure I get is: html>body>(div#outer>div#inner2)+div#inner1