...

View Full Version : get all images in a specified table



MrAtheist
07-15-2009, 01:41 AM
I found this on the other site and I'm just gonna kinda copy & paste...



<table id ="this" >
<tr>
<td><img /></td>
<td><img /></td>
<td><img /></td>
<td><img /></td>
</tr>
</table>


I'm looking for a js function to return all the imgs in that table. Then I'm gonna do setattribute('src',.....)

Any input would be great.

Old Pedant
07-15-2009, 03:23 AM
var imagesInThis = document.getElementById("this").getElementsByTagName("IMG");

But using the name "this" is a rotten idea, because it's apt to be confused with the JavaScript keyword this.

MrAtheist
07-15-2009, 07:10 AM
Ah stupid me for such a simple question...

Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum