Gossamer Forum
Home : General : Perl Programming :

Change class of TD OnMouseOver

Quote Reply
Change class of TD OnMouseOver
Hi

I'm trying to change the class of a TD when the mouse rolls over it, but I'm having no luck at all today.

Can anyone spot what I'm doing wrong with the following code?

Code:
# snippet from external style sheet

.nav-blue-sel { font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: #FFFFFF;
background-color: #0072E5 }

.nav-blue-nor { font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: #0072E5;
background-color: #FFFFFF }

# code in HTML

<td width="77%" class="nav-blue-nor" OnMouseOver="this.class='nav-blue-sel'" height="25">foo</td>

- wil
Quote Reply
Re: [Wil] Change class of TD OnMouseOver In reply to
http://www.jwweb.com/20010204_example2.html

http://google.yahoo.com/...ss&hc=0&hs=0

Last edited by:

RedRum: Feb 26, 2002, 8:59 AM
Quote Reply
Re: [RedRum] Change class of TD OnMouseOver In reply to
Thanks for the links.

- wil

Last edited by:

Wil: Feb 26, 2002, 9:02 AM
Quote Reply
Re: [Wil] Change class of TD OnMouseOver In reply to
Found it! Link 14 on the following page gave me the answer:

http://google.yahoo.com/...nu&hc=0&hs=0

I should use this.className=' and not this.class=' as I had been using.

Thanks for your help.

- wil