I am working on a script, that has a prompt that allows the user to input a color. I gave it the var theground. I have managed to use this to change the bg of the page. what I am wondering is how can I use it to change the bg of a td tr or table? I also have a cookie that remebers the color for each page. I tried this
[code]
<script language=”JavaScript”>
function alternate(id) {
document[id].style.backgroundColor = theground;
}
</script>
<body onload=”alternate(‘thetable’)”>
<table width=”400″ border=”0″ cellpadding=”0″ cellspacing=”0″>
<tr id=”thetable”>
<td> </td>
<td> </td>
<td></td>
<td> </td>
</tr>