tags:

views:

96

answers:

1

Does anyone know how to add an Image on a td element using vbscript? I need to add a "img" element, not a background image, and it has to be vbscript.

<script type="text/vbscript">
function onload()
'//Add Image to td1
end function
<script>
<table>
<tr>
<td id="td1"></td>
</tr>
</table>

Can anybody help me?

Thanks in advance.

+1  A: 

You just use the DOM to do this, just like in JavaScript.

Function onload()
    Dim img

    Set img = document.createElement("img")
    img.src = "http://www.google.com/intl/en_ALL/images/logo.gif"

    document.getElementById("td1").appendChild img
End Function
Tmdean