| Background Color Chooser |
|
|
|
| Written by Andrew Lechlak |
| Saturday, 17 October 2009 06:21 |
|
<!-- 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 --> http://javascript.internet.com/image-effects/background-color-chooser.html |




