title: How to add text + images on Javascript button
body: <p>I have added an image but now I also want to add text as well as the image's heading "Responsive"</p>
  
  <pre><code>&lt;script&gt;
  function pic1()
      {
          document.getElementById("img").src = "../raining.gif";
          ducument.getElementById("text").innerHTML = "&lt;h2&gt; Responsive &lt;/h2&gt;";
      }
  function pic2()
      {
          document.getElementById("img").src ="../movingpiston.gif";
      } 
      &lt;/script&gt;
  
  &lt;img src = "" id = "img"/&gt; 
  &lt;input type="button" value="Responsive" onclick="pic1()"/&gt; 
  &lt;input type="button" value="Reconfiguration" onclick="pic2()"/&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Tr4UB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tr4UB.png" alt="enter image description here"></a></p>