swap image in netscape

M

mr_burns

hi, i am using the following to change an image from one to another.
below is a stripped down version of the code i am using:



function swaptheimage () {

document.GetElementById('theimage').src = 'images/newimage.gif';

}



this works fine in Internet Explorer, but in Netscape what would i
replace 'document.GetElementById('theimage').src' with??? cheers

burnsy
 
G

Grunken

Impresive it works in Internet Explorer :eek:)

Remember : Java script is case sensitive!

document.getElementById('theimage').src = 'images/newimage.gif';

Kind Regards

Nick
 
M

Michael Winter

hi, i am using the following to change an image from one to another.
below is a stripped down version of the code i am using:

function swaptheimage () {
document.GetElementById('theimage').src = 'images/newimage.gif';
}

this works fine in Internet Explorer, but in Netscape what would i
replace 'document.GetElementById('theimage').src' with??? cheers

A simpler and more reliable solution is

document.images[ 'theimage' ].src = URL;

Mike


Please don't use tabs to indent code when posting to newsgroups. Change
them to spaces: between two and four.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top