clonetrooper9494 Posted January 20, 2008 Share Posted January 20, 2008 Ok, I have a span, and need to have it highlighted onmouseover, and highlighted back to normal onmouseout. I have it saying this: <span onmouseover="this.style.background-color = 'BBBBBB'" onmouseout="this.style.background-color = 'EEEEEE'" style='background-color:EEEEEE;'>TEXT</span> But it isn't working... could anybody help me? Link to comment Share on other sites More sharing options...
Ingolme Posted January 20, 2008 Share Posted January 20, 2008 You forgot hashes on the hex color codes:<span onmouseover="this.style.background-color = '#BBBBBB'" onmouseout="this.style.background-color = '#EEEEEE'" style='background-color:#EEEEEE;'>TEXT</span> Link to comment Share on other sites More sharing options...
zppblood Posted January 20, 2008 Share Posted January 20, 2008 When working with styles in Javascript, you don't write it like CSS.Take out the - and capitalize the c in color. <span onmouseover="this.style.backgroundColor = '#BBBBBB'" onmouseout="this.style.backgroundColor = '#EEEEEE'" style='background-color:EEEEEE;'>TEXT</span> Link to comment Share on other sites More sharing options...
clonetrooper9494 Posted January 20, 2008 Author Share Posted January 20, 2008 Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.