jammer20002
09-02-2003, 07:06 PM
I want to change text when the mouse is placed over an image (or other text).
So, for example, you might have a picture in one row and text in the row below. I want the text below to change when the mouse goes over the image.
I posted a question on this before and managed to do the above. BUT... I need a more advanced version. I need to have the text formatted. I need to have a heading. I need to have paragraphs. I've no idea how I can do this?
I'm achieving the above by using the following:
var string1 = "very very very long string";
function setText(text)
{
var obj = document.getElementById("msg");
obj.innerHTML = text;
}
and in the HTML, I have something like the following:
<img src="3.jpg" onmouseover="setText(string1);">
<div id="msg">Initial string</div>
HELP!
I've tried a few variations... but I just can't seem to be able to get any formatting into the string.
THANKS.
Jam
So, for example, you might have a picture in one row and text in the row below. I want the text below to change when the mouse goes over the image.
I posted a question on this before and managed to do the above. BUT... I need a more advanced version. I need to have the text formatted. I need to have a heading. I need to have paragraphs. I've no idea how I can do this?
I'm achieving the above by using the following:
var string1 = "very very very long string";
function setText(text)
{
var obj = document.getElementById("msg");
obj.innerHTML = text;
}
and in the HTML, I have something like the following:
<img src="3.jpg" onmouseover="setText(string1);">
<div id="msg">Initial string</div>
HELP!
I've tried a few variations... but I just can't seem to be able to get any formatting into the string.
THANKS.
Jam