»
EnglishFrenchVietnamese

Print - Background Color Chooser 1 - JavaScriptBank.com

Full version: jsB@nk » Background » Background Color Chooser 1
URL: https://www.javascriptbank.com/change-background-color-by-prompting.html

Background Color Chooser 1 © JavaScriptBank.comLet the visitor choose the background color with a JavaScript prompt box.

Full version: jsB@nk » Background » Background Color Chooser 1
URL: https://www.javascriptbank.com/change-background-color-by-prompting.html



JavaScript
<script language="javascript">/*     This script downloaded from www.JavaScriptBank.com     Come to view and download over 2000+ free javascript at www.JavaScriptBank.com*/function gocolor(){var col = prompt("What colour would you like the page to be?","");alert("The background colour is now "+col+"!!!");document.bgColor=col;};</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<FORM><INPUT onclick=gocolor(); type=button value="Change the Background colour"> <BR><INPUT type=submit value="Reset"></FORM><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->