So basically I have this code:
Javascript:
HTML:Code:var virtualbag = document.getElementById('VirtualBagImage');
The goal is to be able to change the source with virtualbag.src = somethingelse; but if I do this the script stops executing (and of course, javascript never gives any error message).Code:<img id="VirtualBagImage" src="virtualbag.php?bag=1&fabric=75&trim=24&hardware=6&width=150" />
alert(virtualbag); says "null".
I'm hoping I'm just missing something obvious.. I don't have much experience with javascript but I don't understand what's wrong.
Thanks for any help.


Reply With Quote
I just needed it to run after the page loaded..

Bookmarks