title: How to insert HTML element via JavaScript?
body: <p>I want to insert an image into a div tag with the ID "window":</p>
  
  <pre><code>&lt;div id="window"&gt;
          &lt;h3 id="score"&gt;Score: 0&lt;/h3&gt;
          &lt;h3 id="end"&gt;End Game&lt;/h3&gt;
          &lt;video autoplay muted loop id="myVideo"&gt;
              &lt;source src="images/background.mp4" type="video/mp4"&gt;
          &lt;/video&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>What my function looks like atm:</p>
  
  <pre><code>function spawn1() {
  document.getElementById("window").innerHTML = "&lt;img src='images/redtarget.png' style='width:10%'&gt;";
  }
  </code></pre>
  
  <p>How can I insert an HTML element without using .innerHTML since it replaces everything within my div tag?</p>