posted 17 years ago
hi;
i want to change the background color of a <td> cell when the user clicks on it.
i tried to do:
<td onklick="bgcolor='#FFFFFF'"<
(i spelled click with a 'k' on purpose because it wont post otherwise)
i also tried:
<td onklick="this.bgcolor='#FFFFFF'"<
i also tried:
<td onklick="changeColor()"<
where i declared a function:
function changeColor(){
event.srcElement.bgcolor="#FFFFFF"
}
none of these options worked.
What am I doing wrong?