Jump to content

onmouseover change border color?


Dark Knight

Recommended Posts

i'm having a problem with this code:

onMouseover="this.style.border: 1px solid #000000;" onMouseout="this.style.border: 1px solid #FFD700;"

This code should change the border of a cell when the mouse is over that cell. but it dosen't work. where is the problem? thanks for your posts.

Link to comment
Share on other sites

You need to use the assingment operator (=)

onmouseover="this.style.border = '1px solid #000000'" onmouseout="this.style.border = '1px solid #FFD700'"

Link to comment
Share on other sites

You could also use CSS:

#id {border-color: #000000;}#id:hover {border-color: #FF0000;}

Where id is the id of your element, and the border-color is the hexidecimal or named color of your choice.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...