This useless page requires a browser supporting JavaScript 1.1 or greater.
(That is, Netscape Navigator 3.0 or greater or Microsoft Internet Explorer 4.0
or greater.)
Instructions: Simply click on a colored box to change the background color of this page to that color. Pretty useless, huh?
This is the original version of my script. It worked fine until I decided to use a style sheet on the page. In newer browsers (Netscape 6.2 and IE 5.5, at least), JavaScript cannot change the background color using document.bgColor if you specify a background color for the BODY tag using styles (instead of the HTML attribute, BGCOLOR), either in a style sheet or as an inline style on the BODY element. To see what I'm talking about, go here.
To see the updated version, go here.
Return to
Lee's Useless JavaScript Examples.
Author: Lee K. Seitz
Created: 14 Jan 1999; Last Modified: 26 Jan 2003