title: window.print() not working as expected
body: <p>I'm a beginner in JavaScript. So this question might sound silly. As I understand, <code>window.print()</code>, it prints the content or <code>innerHTML</code> in the body tag of the document in the window. In the following snippet, </p>
  
  <p>My HTML Page : </p>
  
  <pre><code> &lt;html&gt;
  
        &lt;head&gt;
          &lt;link rel="stylesheet" href="style.css"&gt;  
        &lt;/head&gt;
  
        &lt;body&gt;
          &lt;h1&gt;Hello Plunker!&lt;/h1&gt;
          &lt;h2&gt;Hi this is a header&lt;/h2&gt;
          &lt;h3&gt;Hi this is a header 2&lt;/h3&gt;
          &lt;script src="script.js"&gt;&lt;/script&gt;
        &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>My Js code:(script.js) Here I am just making the body of the document as Hello world</p>
  
  <pre><code>var restore = document.body.innerHTML;
  document.body.innerHTML = "Hello World";
  window.print();
  document.body.innerHTML = restore;
  </code></pre>
  
  <p>In this scenario, shouldn't hello world come up on the print page?</p>
  
  <pre><code>Why is
  
         Hello Plunker!
         Hi this is a header
         Hi, this is a header 2 coming up?
  </code></pre>
  
  <p>Edit: I had missed the last line where the innerhtml of the body is set back again to restore. Thanks for the help</p>