Click to See Complete Forum and Search --> : onmouseover change text


resullivan
04-21-2005, 09:11 PM
I want to beable to make it so when there is a mouseover on a link I want to change what the text says on a different part of the page. Is this possible? I was thinking something like document.txt1.font = "new font"; but this doesnt work.

phpnovice
04-21-2005, 09:19 PM
If on one part of the page you have the following:

<span id="myText">some text</span>

then on another part of the page you can have the following link:

<a href="someurl" onmouseover="
document.getElementById('myText').firstChild.data = 'some other text';
return true;" onmouseout="
document.getElementById('myText').firstChild.data = 'some text';
return true;">link text</a>

resullivan
04-21-2005, 09:42 PM
Cool, thank you for the help.

phpnovice
04-22-2005, 09:26 AM
Cheers.