You are here: irt.org | FAQ | JavaScript | Image | Q668 [ previous next ]
Try:
<IMG SRC="default.gif" NAME="myImage"> <SCRIPT LANGUAGE="JavaScript"><!-- function change(what) { value = what.options[what.selectedIndex].value; if (value != '') if (document.images) document.images['myImage'].src = value; } //--></SCRIPT> <FORM> <SELECT onChange="change(this)"> <OPTION>Select an animal: <OPTION VALUE="chicken.gif">Chicken <OPTION VALUE="cat.gif">Cat <OPTION VALUE="bear.gif">Bear </SELECT> </FORM>