title: Javascript load image source either jpg or png
body: <p>hi i am using javascript to load an image by name either png or jpg. Please help me.</p>
  
  <pre><code>&lt;body&gt;
  &lt;img id="imageid" /&gt;
  .....
  &lt;script&gt;
  ...     
      document.getElementById("imageid").src=imgUrl+".png" or ".jpg"
  ....
  &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>