[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

DHTML and OnMouseOver Event

I have a textarea field on my page that I want to use to display a short description of a link when the user moves the mouse over the link. I want to create an array that contains the link descriptions then have the onmouseover event call a function that references the corresponding array element for the that link. Below is the code I've got so far. I don't get an error, but the text will not change when the mouse moves over the link.

<form method="POST" action="--WEBBOT-SELF--">
<p><textarea rows="2" id="LinkTextBox" name="LinkTextBox" cols="29" style="color: #000080">Default text goes here.</textarea></p>
      <script language="JavaScript">
       changetext=new Array()
       changetext[0]="Welcome to my menu, mouseover the item text to see what they are."
            changetext[1]="This is info about item 1"
            changetext[2]="This is info about item 2"
            changetext[4]="And last but not least, item 4"
            function changelinkboxtext(num){
        <li><a onmouseover="changelinkboxtext(1)" HREF="LINK.HTM">Menu Item 1</a> <br>
1 Solution
Don't know if it's an acceptable answer, but you might consider using the 'title' property of your links.  At least in IE, it produces a popup when you mouseover the link.

Other than that, I think you are talking about a DHTML solution, which would require <DIV>s or <LAYER>s and onmouseover/onmouseout combinations.

The 'title' solution will also not 'intrude' on the layout of your HTML, which the other solution will.

have you try going the old way to it?

document.formname.textareaname.value = ......


remember, name property and id property might be different.
I know this probably sounds silly....

but, you are setting the innertext property, when you should be setting the innerText property (uppercase T).

Javascript is case-sensitive.

That was easy :))

bgarlandAuthor Commented:
You're right...that was too easy.

Thanks to PBall too. Using the Value property worked just as well.

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now