Forum Moderators: not2easy
Suppose my <TD>'s ID is "button." This onmouseover code will work in IE 5 and 6, but not Netscape:
onmouseover="button.style.backgroundColor='#5778E1';"
Can anyone tell me what I'm doing wrong? Thanks...
caps don't matter for onMoUsEoVEr, or any attributes for that matter. I did some reading on other newsgroups and I have heard a lot of people lamenting that you can't dynamically change TD or TR background colors in Netscape. If that's true, I'll just have to try something else. :-(
onMouseOver="this.bgColor='#CCCCCC';" onMouseOut="this.bgColor='#FFFFFF';"
Don't include onMouseOut if you want to keep the color after teh rollover.
regards,
Mark
document.getElementById('button').style.backgroundColor = '#5778E1';
Mozilla doesn't have 'magic' id elements. Magic variables are the evilist of evil evils (which makes most PHP scripts evil). Magic encourages lazy, unmaintainable code.
If your browser supports :hover (really supports it, not just for <a> elements), you could do td:hover { background: #5778e1 }.