Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need syntax help for onmouseover

Status
Not open for further replies.

vb6novice

Programmer
Sep 23, 2002
288
US
I want several things to occur on a mouseover of a table row. Specifically, bgColor to change, text color to change, cursor change to hand, and then all change back on the mouseout. I know how to code one thing, but not three. I don't want to use the

What's the syntax to put these three actions together in the onmouseover event.
Code:
<tr onmouseover=&quot;this.bgColor='#B1B18C'
... Now what?
 
You could change all that by separating each command with a semi-colon. A much better way is to create a class with all the changes and simply change the class on mouseover.
Code:
<style>
.hilight {
 background: #B1B18C;
 color: #333333;
 cursor: pointer;
}

.normal { ... }
</style>

<tr onmouseover=&quot;this.className='hilight'&quot; onmouseout=&quot;this.className='normal'&quot; class=&quot;normal&quot;>
This way the tr has a normal class (which you describe to your liking) that changes to hilight class when mouse is hovering above it. Hope it helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top