I am creating a list using onMouseOver and onMouseOut to change the background color. The first one in the list works, but for the rest firefox gives me the error “unterminated string literal document.getElement(‘c,”, which is odd…
for(i=0;i<connections.length;i++)
{
var stuff = connections[i].split(“:”);
output+=”<table class=”connection” id=”c” + stuff[0] + “” onMouseOver=”document.getElementById(‘c”+stuff[0]+”‘).style.background=’#FF9900′” onMouseOut=”document.getElementById(‘c”+stuff[0]+”‘).style.background=’#FFFFFF'” height=20px width=250px><tr><td width=50px align=”center”>”;
output+=stuff[0]+”</td><td width=100px align=”center”>”+stuff[1]+”</td><td width=100px align=”center”>”+stuff[2]+”</td></tr></table>”;
}
cbox.innerHTML = output;
I cannot see that I am doing something visibly wrong, and it is especially odd that it works for the first element but none of the rest…