Manipulating dom, is this possible?

M

Maurice Kroon

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
 
R

RobG

Maurice said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top