Beck
10-18-2002, 11:57 PM
Anyone know how to access an image's src from a surrounding div tag? My setup is as follows:
<div id=whatever>
<img src=url1>
<img src=url2>
</div>
<div id=whatever1>
<img src=url3>
<img src=url4>
</div>
I have tried the following:
document.all("whatever")[0].src = newurl1;
(which didn't work, needless to say)
Trying to avoid assigning id's to the images, hoping to use some indexing scheme, such as arrays. Need to access through div tag, so the following isn't quite going to cut it:
document.images[0].src = newurl1;
Thanks in Advance
<div id=whatever>
<img src=url1>
<img src=url2>
</div>
<div id=whatever1>
<img src=url3>
<img src=url4>
</div>
I have tried the following:
document.all("whatever")[0].src = newurl1;
(which didn't work, needless to say)
Trying to avoid assigning id's to the images, hoping to use some indexing scheme, such as arrays. Need to access through div tag, so the following isn't quite going to cut it:
document.images[0].src = newurl1;
Thanks in Advance