faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

24 of 58 people (41%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

How can I mouseover a table cell and have text change in another part of the page?

Apr 4th, 2008 20:38
ha mo, Aaron Peterson, jsWalter, Ryan D, http://www.htmlgoodies.com/beyond/dhtml5.html


http://www.htmlgoodies.com/beyond/dhtml5.html
Has a working example

I got something to work:
<div ID="TheID">text</div>
<a href="blahdada" onMouseOver="TheID.innerHTML = 'New Text'">link 
text</a>

This only worked on IE though : (

It's called DHTML. I'm looking for a standards based solution.
-AP


Your questions outlined the solution nicely!

Wrap the text space you want changed in a DIV or a SPAN and give it an 
id (EX: yourID)

add an onMouseOver event to that able Cell in question.

Have that event call a function.

Have that function do a...

    innerHTML.yourID = 'some text';

on the text space you want to change.

Thats it.

Walter



http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com