Connecting Tech Pros Worldwide Help | Site Map

onmouseover change css class

  #1  
Old August 26th, 2008, 02:21 PM
Member
 
Join Date: Jan 2008
Posts: 121
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
  #2  
Old August 26th, 2008, 02:51 PM
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,102
Provided Answers: 1

re: onmouseover change css class


try:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
tab menu - change tabs onmouseover, onmouseout, onclick oll3i answers 10 July 3rd, 2008 11:44 AM
How to do onmouseover/onmouseout events on asp.net button Rob Roberts answers 3 January 28th, 2006 02:35 AM
Changing an elements CSS class style with DHTML bissatch@yahoo.co.uk answers 9 July 23rd, 2005 09:01 PM
change CSS definition by javascript Gerhard Hönig answers 8 July 21st, 2005 02:55 AM