Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DHTML and OnMouseOver Event

Posted on 1999-07-14
4
Medium Priority
?
268 Views
Last Modified: 2013-12-25
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>
      </form>
      <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[3]="Item3"
            changetext[4]="And last but not least, item 4"
            
            function changelinkboxtext(num){
            document.all.LinkTextBox.innertext=changetext[num]
            }
      </script>
      <ul>
        <li><a onmouseover="changelinkboxtext(1)" HREF="LINK.HTM">Menu Item 1</a> <br>
        </li>
0
Comment
Question by:bgarland
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 9

Expert Comment

by:TTom
ID: 1864064
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.

Tom
0
 
LVL 6

Expert Comment

by:PBall
ID: 1864065
have you try going the old way to it?

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

instead?

remember, name property and id property might be different.
0
 
LVL 4

Accepted Solution

by:
brigmar earned 300 total points
ID: 1864066
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 :))

Brian
0
 

Author Comment

by:bgarland
ID: 1864067
You're right...that was too easy.

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

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question