Triggering a Color Change from a Pop-Up Menu
<HTML> <HEAD> <TITLE>Color Changer 2</TITLE> <SCRIPT LANGUAGE="JavaScript"> function seeColor(list) { var newColor = (list.options[list.selectedIndex].value) if (newColor) { document.bgColor = newColor } } </SCRIPT> </HEAD> <BODY onUnload="document.forms[0].reset()"> <FORM> <P>Choose a background color: <SELECT NAME="colorsList" onChange="seeColor(this)"> <OPTION SELECTED VALUE=""> <OPTION VALUE="cornflowerblue">A <OPTION VALUE="darksalmon">B <OPTION VALUE="lightgoldenrodyellow">C <OPTION VALUE="seagreen">D </SELECT> </P> </FORM> </BODY> </HTML>