View Full Version : Change <div> class onmouseover

03-24-2012, 05:16 PM

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.


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