title: How to add an image in a function on javascript
body: <p>Hello I have a function in java script which has some text but now i want to add  an image too.</p>
  
  <p>How to insert an image inside the function ?</p>
  
  <p>Here is the JAVASCRIPT code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function CONshowElements(){
          var Construction = "The construction company with several years of experience in projects valued over millions of USD having Service and Quality with satisfaction and appreciation of the clients";
  
         document.getElementById("contents").innerHTML = Construction;
         var image = new Image;
        image.src = "images/SCALE Construction.png";
            }
        &lt;/script&gt;
  </code></pre>
  
  <p>Body code</p>
  
  <pre><code>  &lt;a href="construction.php"&gt;&lt;div class="firstbox" id="Construction" onmouseover="CONshowElements(); return false; " &gt;Construction&lt;/div&gt;&lt;/a&gt;
  </code></pre>