<!DOCTYPE HTML> <html style="width:1px"> <body><span><span id="y"></span>a b</span> <script> var y = document.getElementById("y"); document.documentElement.offsetHeight; y.appendChild(document.createTextNode("c d")); </script> </body> </html>