...

View Full Version : Change <div> class onmouseover



tomsace
03-24-2012, 04:16 PM
Hey,

I currently have my menu on a web page set out using the following method:

<div class="linkbox" onmouseover="this.className='linkbox2'" onmouseout="this.className='linkbox'" onclick="location.href='http://www.upthegame.net/';"> General Chat </div>

I was wondering if there was a way using javascript to set ALL <div>'s with the class name "linkbox" to change to the class name "linkbox2" onmouseover and return to "linkbox" onmouseout. I would like this to be in a seperate file, I'm guessing this would probably be within an onload function or something along those lines.

I'm only familiar with basic JS so please go easy on me :) Any help is much appreciated.

Thanks,
Tom.

tomsace
03-24-2012, 06:07 PM
I found a lot easier way of doing this using CSS :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum