clonetrooper9494 Posted January 20, 2008 Report 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 Report 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 Report 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 Report Share Posted January 20, 2008 Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now