insertmultiple.html 529 B

1234567891011121314151617181920212223242526272829
  1. <html class="reftest-wait">
  2. <head>
  3. <script>
  4. function boom()
  5. {
  6. document.body.offsetHeight;
  7. var lastdiv = document.getElementById("last");
  8. var parent = lastdiv.parentNode;
  9. for (var i = 2; i <= 4; i++) {
  10. var newdiv = document.createElement("div");
  11. newdiv.appendChild(document.createTextNode(i));
  12. parent.insertBefore(newdiv, lastdiv);
  13. }
  14. document.body.offsetHeight;
  15. document.documentElement.className = "";
  16. }
  17. </script>
  18. </head>
  19. <body onload="boom();">
  20. <div>1</div>
  21. <div id="last">5</div>
  22. </body>
  23. </html>