Manipulating dom, is this possible?

Discussion in 'Javascript' started by Maurice Kroon, Sep 28, 2007.

  1. I'm working on a thing here, and I'm not able to fix it, i'm not even
    sure if it's possible, but i would like to know..

    This is the code.
    <li>some text <a href="someurl">someurl</a> some text</li>

    ...

    <div id="sometextholder"></div>

    Now, the challenge.
    In normal situation, the sometext is display:none, and only the <a>
    remain. Is this possible? Because to my knowledge I would have to use
    classes, but i hope it is..

    On a mouseover, i would like to see the whole contents of the li, in a
    different div (sometextholder).

    Thanks in advance,

    Kind regards,

    Maurice Kroon
     
    Maurice Kroon, Sep 28, 2007
    #1
    1. Advertising

  2. Maurice Kroon

    RobG Guest

    Maurice Kroon wrote:
    > I'm working on a thing here, and I'm not able to fix it, i'm not even
    > sure if it's possible, but i would like to know..
    >
    > This is the code.
    > <li>some text <a href="someurl">someurl</a> some text</li>
    >
    > ..
    >
    > <div id="sometextholder"></div>
    >
    > Now, the challenge.
    > In normal situation, the sometext is display:none, and only the <a>
    > remain. Is this possible? Because to my knowledge I would have to use
    > classes, but i hope it is..
    >
    > On a mouseover, i would like to see the whole contents of the li, in a
    > different div (sometextholder).


    It can be done:

    <ul>
    <li>some text <a href="someurl"
    onmouseover="
    document.getElementById('sometextholder').innerHTML =
    this.parentNode.firstChild.data;
    " onmouseout="
    document.getElementById('sometextholder').innerHTML = '';
    ">someurl</a> some text
    </ul>

    <div id="sometextholder"></div>


    That is but a proof of concept, nothing more.



    --
    Rob
    "We shall not cease from exploration, and the end of all our
    exploring will be to arrive where we started and know the
    place for the first time." -- T. S. Eliot
     
    RobG, Sep 28, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ray
    Replies:
    2
    Views:
    402
  2. Veit Wiessner
    Replies:
    5
    Views:
    456
    Veit Wiessner
    Dec 3, 2003
  3. jab3
    Replies:
    2
    Views:
    110
  4. Peter Michaux

    Manipulating the DOM during page load.

    Peter Michaux, Dec 6, 2006, in forum: Javascript
    Replies:
    1
    Views:
    98
    naixn
    Dec 6, 2006
  5. BerlinBrown
    Replies:
    5
    Views:
    339
    BerlinBrown
    Feb 5, 2008
Loading...

Share This Page