topical media & game development
graphic-javascript-effect-background-choose-effect.htm / htm
<!-- ONE STEP TO INSTALL BACKGROUND COLOR CHOOSER:
1. Copy the coding into the HEAD of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
// Ask the user for a color preference
var displayColor = prompt("What background color do you want?", "yellow")
// The default text color is black
var textColor = "black"
// If the user chooses a black background, change the text to white
// so it is visible
if (displayColor == "black" || displayColor == "#000000" || displayColor == null) {
textColor = "white"
}
// Display page content
document.writeln("<BODY BGCOLOR=" + displayColor + " TEXT=" + textColor + ">You chose " + displayColor + "</BODY>")
// End -->
</script>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 1.00 KB -->
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.