title: Javascript populate a section of the page on button click with image and text
body: <p>I am trying to make a dynamic webpage that has buttons to filter products based on category's, I have managed to get it to repopulate the page with text using this code:</p>
  
  <pre><code>&lt;script&gt;
  function myFunction() {
  document.getElementById("demo").innerHTML = "&lt;main&gt;Hello World&lt;/main&gt;";
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>However I also need it to load a image and place it to the left within the  tag, I have tried using the src method:</p>
  
  <pre><code>("image").src ="image.gif";
  </code></pre>
  
  <p>but I had no luck with it, and after searching for quite some time I decided to ask here, thanks to anyone who can help me. </p>