Javascript img

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Why does not the following work in IE7 (not sure if it works in IE6)? It
works in , for instance, Mozilla Firefox.

document.images['myImg'].src = Pics[Index1].src;

<img name="myImg" ...
 
Hi Jo,

I am only guessing, too lazy to set up a test bench. Try
document.getElementById('myImg').src = Pics[Index1].src;
<img name="myImg" id="myImg"

Regards.
 
Hi Rob and thanks for your reply,

I have tried all of the following without success

document.getElementById
document.getElementByName
document.images
window.document.getElementById
window.document.getElementByName
window.document.images
window.document.body.childNodes // It doesn't exist in here, perhaps it
should?!


Regards,
Joachim


Rob ^_^ said:
Hi Jo,

I am only guessing, too lazy to set up a test bench. Try
document.getElementById('myImg').src = Pics[Index1].src;
<img name="myImg" id="myImg"

Regards.
Joachim said:
Why does not the following work in IE7 (not sure if it works in IE6)? It
works in , for instance, Mozilla Firefox.

document.images['myImg'].src = Pics[Index1].src;

<img name="myImg" ...
 
Back
Top