Connecting Tech Pros Worldwide Help | Site Map

onmouseover change css class

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 26th, 2008, 01:21 PM
Member
 
Join Date: Jan 2008
Posts: 118
Default onmouseover change css class

Hi,

What i want to do is when i mouseover an image it changes the class of a div that is somewhere on the page.

I thought i could do this by doing:

[HTML]
<div class="header_image2" name="remote" id="remote">
<div id="header_image2_inner">
<img src="images/composite-decking-sm.JPG" height="75" hspace="2" border="0" onmouseover="remote.className = 'composite1';" onmouseout="remote.className = 'header_image2';"/>
</div>
</div>
[/HTML]

But this does not work, any ideas?

Cheers,
Adam
Reply
  #2  
Old August 26th, 2008, 01:51 PM
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Age: 37
Posts: 3,780
Default

try:

Expand|Select|Wrap|Line Numbers
  1. onmouseover="document.getElementById('remote').className = 'composite1';"
kind regards
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.