C
CQMMAN
Hello,
I am trying to change a piece of text using onmouseover. I have tried a few
things so far and nothing has really worked. I get get a new piece of text
to appear but bastardizing someone elses code, but can't figure out how to
hide the other one....
I sort of have the following but don't know if this is close to the best way
of doing it really...
Basically I want to have a piece of text, lets say TEXT1, that changes from
blue to red, and to TEXT2 while the mouse is over it.
I know nothing really about Java so have had a look around but got no
futher. Any help would be great.
Cheers
<html>
<head>
<script type="text/JavaScript">
function setText(t){
if(document.layers)
{
with(document.layers["myDiv"].document)
{
open();
write(t);
close();
}
}
else if(document.all)
{
myDiv.innerHTML = t;
}
}
</script>
</head>
<body>
<a href="#"
onmouseover="setText('test2)",
onmouseout="setText('')">test1</a>
<br>
<div style="position:absolute;top:14;left:11;width:100;" name="myDiv"
id="myDiv"></div>
</body>
</html>
I am trying to change a piece of text using onmouseover. I have tried a few
things so far and nothing has really worked. I get get a new piece of text
to appear but bastardizing someone elses code, but can't figure out how to
hide the other one....
I sort of have the following but don't know if this is close to the best way
of doing it really...
Basically I want to have a piece of text, lets say TEXT1, that changes from
blue to red, and to TEXT2 while the mouse is over it.
I know nothing really about Java so have had a look around but got no
futher. Any help would be great.
Cheers
<html>
<head>
<script type="text/JavaScript">
function setText(t){
if(document.layers)
{
with(document.layers["myDiv"].document)
{
open();
write(t);
close();
}
}
else if(document.all)
{
myDiv.innerHTML = t;
}
}
</script>
</head>
<body>
<a href="#"
onmouseover="setText('test2)",
onmouseout="setText('')">test1</a>
<br>
<div style="position:absolute;top:14;left:11;width:100;" name="myDiv"
id="myDiv"></div>
</body>
</html>