Please enter your color and then click the button.
DON`T use ENTER, push button!
You can write the color number as well i.e. #463098
Use REFRESH to get back to white background.



Put this between your HEAD-tags:
<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>

Put this between your BODY-tags:
<FORM>
<BR>
<input type="text" name="text">
<input type="button" name="button" value="click for color!" onClick="test(this.form)">
</FORM>

Free JavaScripts provided
by Winfolinx.com

Back