I have a html page in which there is an image in anchor tag code is :
try following instead of changing innerHTML.
function changeImage() { var parent = documeent.getElementById('x'); parent.getElementsByTagName("img")[0].src = "newUrl"; }