when I click on something I want to call a function that can change the background color of a <TD> tag within a table on the same web page
I have the click call working and my function is ready to pass on its value but this is were im completely stuck
im able to set the background color manually by including a bgcolor= command within the tag but I have no clue on how to give this tag some sort of i.d. so that I can set it externally ??
examble of the table code and javascript function
Code: Select all
<table>
<tr>
<td bgcolor=#ff0000>
this background should change color when the function is called
</td>
</tr>
</table>
<script language="JavaScript><!--
function changecolor(){
var newcolor=#0000ff;
do something with newcolor ?????? HELP!
}
--></script>
would really be nice if someone could post working code here that I can use as a foundation to build upon
thankyou.