Forum Moderators: open

Message Too Old, No Replies

Onmouse(action) change style of an object with an id?

         

JAB Creations

10:26 pm on Jul 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have two fields that I want to have users go back and forth between. There will be a div on the left which contains links that when clicked will change the class of the associated div on the right. How do I change the class of a div onmousedown from a different part of the page?

I plan on using onmouseout to reset the div's class which will use display: none;.

j4mes

12:31 pm on Jul 3, 2005 (gmt 0)

10+ Year Member



Give your div an id (in this example id="mydiv"), then use:

document.getElementById("mydiv").style.display = "none";

with your onmousedown/out, changing "none" as appropriate.

J.