title: Adding image using javascript
body: <p>I have a html page in which there is an image in anchor tag code is :</p>
  
  <pre><code>&lt;a href="www.google.com" id="x"&gt;&lt;img src="images/test.png" /&gt;&lt;/a&gt;
  </code></pre>
  
  <p>on body onload event i am calling a javascript function which dynamically changes the image . My code is:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function changeImage()
  {
    document.getElementById('x').innerHTML= '&lt;img src="images/test2.png" /&gt;'; 
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>This is working fine in firefox but not working in google chrome and ie. Please help..</p>