Forum Moderators: phranque
img1off = new Image();
img1off.src = "images/home_off.gif";
<img src='img1off.src' name="img1" width="100" height="30" border="0">
When I look at the page in the browser there is no image. Is there a way to do this or do I have to use:
<img src="images/home_off.gif".....>
Thanks
<img src="images/home_off.gif".....> will work.
Otherwise, if you're genuinely using something that varies, in your Javascript try
document.write('<img src="' + img1off + '" name="img1" width="100" height="30" border="0"');
after assigning a string containing the file name of the image (eg "images/home_off.gif") to img1off.
If this is not really what you want, perhaps you could explain a bit more.