You are here: irt.org | FAQ | JavaScript | Image | Q900 [ previous next ]
Yes - using the onChange event handler:
<script language="JavaScript"><!-- function swap(source) { if (document.images) { document.images['myImage'].src = source; } } //--></script> <img src="image.gif" name="myImage" width="100" height="100"> <form> <select onChange="swap(this.options[selectedIndex].value)"> <option value="image0.gif">Show image 0 <option value="image1.gif">Show image 1 <option value="image2.gif">Show image 2 <option value="image3.gif">Show image 3 </select> </form>