<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>DOM Level 0: document.write()</title>
  <script type="text/javascript"><![CDATA[
   function test() {
     var s = document.getElementById('result').firstChild;
     s.data = "Test did not complete.";
     var w = window.open('about:blank', '');
     w.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">\n<html lang="en">\n <head>\n  <title>Test</title>\n  <style type="text/css">\n   p { color: green; }\n  </style>\n </head>\n <body>\n  <p>PASS</p>\n </body>\n</html>');
     w.document.close();
     s.data = "Test ran. A window should have popped up and said PASS.";
   }
  ]]></script>
 </head>
 <body>
  <p><input type="button" value="Click here to run the test. A window should pop up and say PASS." onclick="test()"/></p>
  <p id="result">Test has not yet run.</p>
 </body>
</html>
