Jump to content

Quick Simple Problem...


clonetrooper9494

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...