Choose Background Color

[Total: 0    Average: 0/5]

This allows the user to select the background color to change to.

Body Code:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function test(form) {
if (form.text.value == "")
alert("What's your favorite color?")
else { 
document.bgColor=(""+form.text.value+"");
   }
}
// End -->
</SCRIPT>
<CENTER>
<FORM>
<B>Please enter your favorite<BR>
color and then click the button.<BR>
<input type="text" name="text">
<input type="button" name="button" value="click for color!" onClick="test(this.form)">
</FORM>
</CENTER>

Times Viewed: 2

Leave a Reply

Your email address will not be published. Required fields are marked *