Mouseover Text - Popup Problem

Hey Everyone-
For some reason I’m can’t figure this out and I’m sure it’s simple. I must be rusty…

Anyway, I’ve been working with a javascript that makes text popup (in a seperate DIV) when you rollover a link.

This is in the header:

<script language="JavaScript">
<!--
function change(html){
description.innerHTML=html
}
//-->
</script>

This is the link code:

<a href="url goes here" onmouseover="javascript:change('This is description of the link')" onmouseout="javascript:change('')">Link Text Here</a>

This is the DIV where text pops-up:

<div id="description"></div>

So what I was wanting to do is put paragraph tags in the link code where I add a description like this:

<a href="url goes here" onmouseover="javascript:change('<p>I WANT A PARAGRAPH HERE</p><p>I WANT A SECOND PARAGRAPH HERE</p>')" onmouseout="javascript:change('')">Link Text Here</a>

So basically I want to have multiple paragraphs in the description area but javascript doesn’t like when i put the paragraph tags in
Is there a way around this?

Thanks You Much
Cheers
-Landon

What do you mean when you say “javascript doesn’t like when I put the paragraph tags in”? JS doesn’t really care if you are injecting a p (or any other) tag into your page using innerHTML, it is perfectly acceptable. Is this working at all? Has it worked yet? Does it stop working when you use the p tag? Please elaborate. Thanks! :slight_smile:

Also, I noticed you are not using document.getElementById(‘description’).innerHTML = html, are you getting your div object elsewhere? This may be the cause of your problem.