#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    4
    Rep Power
    0

    Question Javascript/ HTML Objects!


    Hia all.. Hope someone can help me here!?

    On my webpage, when a user hovers over a table it changes color... I also need to be able to do this from a hyperlink...


    IE, I want Table1 to change color when the user hovers over hyperlink1, and table2 to change color when the user hovers over hyperlink2...


    Anyone got any ideas?

    Thanx in advance to all that can help!

    Si.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2003
    Posts
    1,014
    Rep Power
    15
    Give your table an id attribute, e.g.:
    <table id="mytable1">
    The following will change the color from white to red and back:
    Code:
    <a href="whatever" onmouseover='document.getElementById("mytable1").style.backgroundColor="red"' onmouseout='document.getElementById("mytable1").style.backgroundColor="white"'>linktext</a>
    (Works in modern browsers, not in NS4)

    Hope this helps,
    Jeroen

IMN logo majestic logo threadwatch logo seochat tools logo