Change Background Colors | JavaScriptSource

Change Background Colors

JavaScriptSource Staff Apr 9, 2008


Use this snippet to let your visitors change the background color of your Web page. Combined with a cookie, the setting could follow them through your whole site.


  • Created by: A&M
  • Posted: April 9, 2008

Source Code

Paste this source code into the designated areas.


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document

Leave a Response


Thanks for the cool example. Those who try this one out, make sure to include script tags so it works right: [removed] function bgChange() { document.bgColor=document.getElementById("bgForm").txt.value; } [removed]

J P Aug 14, 2013

In order to better help you, you'll need to post your question [a href=""]over on the forums[/a].

Lee Jun 26, 2008

I can't get the change background color to work on my site. I added the code and it tries but it is not succeeding at the change. Any ideas what is wrong?[br /]Celia

Celia Bandelier Apr 9, 2008