Insert javascript help

  • Thread starter Thread starter Paul M
  • Start date Start date
P

Paul M

Hi
I wish to insert a mousover event in here so when the mouse hovers over the
div another class is activated changing the div background colour.

<div class="menutitle" onclick="SwitchMenu('sub4')"><a href="#">Cool
Links</a></div>

Thanks
Paul M
 
Paul M said:
Hi
I wish to insert a mousover event in here so when the mouse hovers over the div another class is activated
changing the div background colour.

<div class="menutitle" onclick="SwitchMenu('sub4')"><a href="#">Cool Links</a></div>

Thanks
Paul M
Add this: onmouseover="this.className='the_other_class'"

like this:
<div class="menutitle" onmouseover="this.className='the_other_class'" onclick="SwitchMenu('sub4')"><a
href="#">Cool

Note the use of both single and double quotes:
onmouseover=*"*this.className=*'*the_other_class*'**"*

I placed them between * to point them out.


--

Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm
 
Thanks Steve
One more thing learnt
Paul M

Steve Easton said:
Add this: onmouseover="this.className='the_other_class'"

like this:
<div class="menutitle" onmouseover="this.className='the_other_class'"
onclick="SwitchMenu('sub4')"><a href="#">Cool

Note the use of both single and double quotes:
onmouseover=*"*this.className=*'*the_other_class*'**"*

I placed them between * to point them out.


--

Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm
 
Back
Top