var x = document.getElementById("pic");
x.src='path.jpg';
Shouldn’t this replace the source of the the image with the id ‘pic’ ?
What am I doing wrong?
When I right-click and check the source of the html in my browser, the image ‘src’ have not yet been changed!
Thanks
You wouldn’t see the change reflected in the source. You need something like FireBug to see changes to the DOM.