This script was submitted earlier by COBOLdinosaur. I was just wondering if it were possible to take that new background color and make it the initial background color for a second page that has the exact same script on it.

<html>
<head>
<title>Table Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
.cls1 {background-color:#ccccff}
.cls2 {background-color:#ccffcc}
</style>
<script language="JavaScript">
function changeBG() {
x=document.getElementsByTagName('table');
for (i=0;i<x.length;i++) {
pntr=x[i].id;
if (document.getElementById(pntr).className=="cls1")
{ document.getElementById(pntr).className="cls2"; }
}
}
</script>





</head>
<body bgcolor="#888888">

<center><FORM><INPUT TYPE="button" VALUE="CLICK to change ALL tables with a PURPLE background to a GREEN background" ONCLICK="java script:changeBG()"></FORM></center>

<hr color="#000000"><br><br>

<br><br>
<table id="a" border="1" cellspacing="0" width="100%" class="cls1">
<tr><td align="center" width="100%" height="27">
<font size="4" color="#000000"><b>TABLE #1</b></font>
</td></tr>
</table>

<br><br>
<table id="b" border="1" cellspacing="0" width="100%" bgcolor="#666666">
<tr><td align="center" width="100%" height="27">
<font size="4" color="#000000"><b>TABLE #2</b></font>
</td></tr>
</table>

<br><br>
<table id="c" border="1" cellspacing="0" width="100%" class="cls1">
<tr><td align="center" width="100%" height="27">
<font size="4" color="#000000"><b>TABLE #3</b></font>
</td></tr>
</table>

<br><br>
<table id="d" border="1" cellspacing="0" width="100%" bgcolor="#666666">
<tr><td align="center" width="100%" height="27">
<font size="4" color="#000000"><b>TABLE #4</b></font>
</td></tr>
</table>

<br><br><br><br><hr color="#000000"><CENTER><B>TESTING RESULTS SHOULD BE:</B></CENTER>

<br>
<table border="1" cellspacing="0" width="100%" bgcolor="#CDCCFF">
<tr><td align="center" width="100%" height="27">
<font size="4" color="#000000"><b>BEFORE BUTTON CLICK, TABLES #1 & #3 SHOULD HAVE A COLOR CLOSE TO THIS ONE</b></font>
</td></tr>
</table>

<br>
<table border="1" cellspacing="0" width="100%" bgcolor="#CCFFCC">
<tr><td align="center" width="100%" height="27">
<font size="4" color="#000000"><b>AFTER BUTTON CLICK, TABLES #1 & #3 SHOULD CHANGE TO THIS COLOR</b></font>
</td></tr>
</table>

<br>
<table border="1" cellspacing="0" width="100%" bgcolor="#666666">
<tr><td align="center" width="100%" height="27">
<font size="4" color="#000000"><b>AFTER BUTTON CLICK, TABLES #2 & #4 SHOULD REMAIN WITH THIS COLOR</b></font>
</td></tr>
</table>

</body>
</html>