title: Create a Document object, run JavaScript in it, and get final HTML
body: <pre><code>let html = '&lt;body&gt;&lt;p id="a"&gt;&lt;/p&gt;&lt;script&gt;document.getElementById("a").innerHTML = "hello"&lt;/script&gt;&lt;/body&gt;'
  let doc = document.implementation.createHTMLDocument('')
  doc.open()
  doc.write(html)
  doc.close()
  doc.getElementById('a').innerHTML // expecting "hello" but get an empty string instead
  </code></pre>
  
  <p>The HTML document created by <code>document.implementation.createHTMLDocument</code> doesn't seem to run JavaScript inside it.</p>