<!DOCTYPE HTML> <html> <head> <script> function tweak() { var oldShadowRoot = document.getElementById('outer').createShadowRoot(); oldShadowRoot.innerHTML = 'World'; var youngShadowRoot = document.getElementById('outer').createShadowRoot(); youngShadowRoot.innerHTML = 'Hello<content></content><shadow></shadow>'; } </script> </head> <body onload="tweak()"> <div id="outer"></div> </body> </html>