Full version: jsB@nk » Background » Type-A-Color
URL: https://www.javascriptbank.com/type-a-color.html
This JavaScript is another neat way to spice up your webpage with JavaScript. Visitors just type their favorite color in the box and click a button. The background is instantly changed to their favorite color
Full version: jsB@nk » Background » Type-A-Color
URL: https://www.javascriptbank.com/type-a-color.html
<script language="javascript">/* This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com*/<!-- Begin// author: Eric Stremming (estremming@hotmail.com)function test(form) {if (form.text.value == "")alert("What\'s your favorite color?")else { document.bgColor=(""+form.text.value+""); }}// End --></SCRIPT><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<FORM>Please enter your favorite<BR>color and then click the button.<BR><input type="text" name="text" size="20"><input type="button" name="button" value="click for color!" onClick="test(this.form)"></FORM><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->