changing content of a DIV using JS

Discussion in 'JavaScript' started by Scott, Sep 30, 2005.

  1. #1
    hey,

    Is it possible to change the content of a div(or anything similar) by an "a href" link and onmouseover? I've been trying to work it out but I'm not sure how I could do it.

    Any help would be appreciated.

    Thanks,
    S
     
    Scott, Sep 30, 2005 IP
  2. Epica

    Epica Well-Known Member

    Messages:
    1,007
    Likes Received:
    95
    Best Answers:
    0
    Trophy Points:
    170
  3. Scott

    Scott Peon

    Messages:
    273
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Scott, Sep 30, 2005 IP
  4. Scott

    Scott Peon

    Messages:
    273
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    nevermind, thanks. got it working.

    <html>
    <head>
    <title>Test</title>
    <script language="javascript">
    <!--
    function changeZoom(value) {
     document.getElementById("zoomin").innerHTML = value;
    }
    //-->
    </script>
    </head>
    <body>
    <div id="zoomin"></div><br /><br />
    <a href="#" onmouseover="changeZoom('a');">a</a> ... <a href="#" onmouseover="changeZoom('b');">b</a>
    </body>
    </html>
    Code (markup):
     
    Scott, Sep 30, 2005 IP
  5. Amos

    Amos Peon

    Messages:
    224
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    That could be useful to me later. Thanks for posting the solution.
     
    Amos, Oct 5, 2005 IP