The code i am using:
Expand|Select|Wrap|Line Numbers
- ChangeIt(id){
- var target = document.getElementById(id)
- var newColor = "#00ff33"
- target.style.color = newColor
- }
[php]
echo("<tr bgcolor=".$bgco lor.">
<td id=\"s".$counte r."\" onclick=\"Chang eIt('s".$counte r."');\">\n") ;
echo $counter;
$counter++; //increment counter
echo("</td><td>\n");
echo($row['url']);
echo("</td><td>\n");
echo($row['Util_Uploaded']);
echo("</td></tr>\n");
}
[/php]
I'm trying to get an onclick event where it catches the ID of the tag and then changes the style of said tag.
I get this error though:
Event thread: click
Error:
name: ReferenceError
message: Statement on line 1: Reference to undefined variable: ChangeIt
Backtrace:
Line 1 of script
ChangeIt("s2");
At unknown location
[statement source code not available]
What am i doing wrong?
Thanks.