More Info


You are in: home > javascript > javascript api >

JavaScript API

Change Image - changeImage()

Changes the source the source of "target" to "source".

The Code

function changeImage(target, source) {
	var imageObj;
	
	if (ns4) {
		imageObj = getImage(target);
		if (imageObj) imageObj.src = eval(source).src; 
	} else {
		imageObj = eval('document.images.' + target);
		if (imageObj) imageObj.src = eval(source).src; 
	}
}
<< PREVIOUS PAGE: Change Style Class NEXT PAGE: Change Background Colour





 © James Austin 2002-05 Web site design by James Austin