DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Change The Background Color Of The Page

  • submit to reddit
        This is a kind of useless piece of JavaScript code, although I suppose it could be useful for something. Whether this is just a waste of time or not, I will present you with the code straightaway, that will allow you to dynamically change the background color of the page. 

<script language="JavaScript">
function changeBGC(color){
document.bgColor = color;

<a href="#" onClick="javascript:changeBGC('#000099')">Click Blue</a>

<a href=""><strong>Eclipse</strong></a> and <a href=""><strong>Eclipse IDE</strong></a> tips.