Solved

Change text with onmouseover/onmouseout

Posted on 2001-08-10
7
160 Views
Last Modified: 2012-05-04
We can change images with onmouse.... events. But I'd like to change text with this events. Can I do it?

Thanks.

0
Comment
Question by:tsuyoshi
[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
  • 2
7 Comments
 
LVL 14

Expert Comment

by:avner
ID: 6374012
a simple IE only example is :

<SPAN onmouseover="this.innerText='MOSHE !!!'" onmouseout="this.innerText='NONONO !!!'">Roll Over ME</SPAN>
0
 
LVL 14

Expert Comment

by:avner
ID: 6374017
something more Cross Brosers would be :

<SCRIPT LANGUAGE="JavaScript">
<!--
sON="<font color='#FF3366'>test</font>"
sOUT="<font color='#663399'>test</font>"
function ch(that){
if (document.all) {

if (that==1) moshe.style.color="#FF3366";
else
moshe.style.color="#663399";
}
          else {
          ref=document.layers.w.layers.moshe.document
if (that==1) {ref.write(sON);ref.close();}
else
{ref.write(sOUT);ref.close();}
}
}
//-->
</SCRIPT>
<layer id="w" name="w" onMouseOver="ch('1')" onMouseOut="ch('2')">
<div id=moshe name=moshe style="position:absolute" onMouseOver="ch('1')" onMouseOut="ch('2')">
test
</div>
<layer>
0
 

Author Comment

by:tsuyoshi
ID: 6374051
Ok thank you. But I think that it isn't what I really need.
I'd like to pass the mouse over the picture, and change a text in another place, like a status panel.

PS:Sorry if my English is wrong.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Accepted Solution

by:
avner earned 100 total points
ID: 6374058
Same thing :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
//[avnerc@fundtech.co.il]

//-->
</SCRIPT>
</HEAD>

<BODY>
<IMG SRC="http://www.experts-exchange.com/images/kp_logo2.gif" onmouseover="document.all.moshe.innerText='Lilili'" onmouseout='document.all.moshe.innerText="lslsls"'><br/>
<br/>
<br/><SPAN id="moshe" name="moshe">Litltl</SPAN>
</BODY>
</HTML>
0
 

Author Comment

by:tsuyoshi
ID: 6374083
YES! Thank you very much!

PS: You're very fast to answer!
0
 
LVL 14

Expert Comment

by:avner
ID: 6374132
You are more then welcome.
0
 
LVL 1

Expert Comment

by:arauramo
ID: 7391294
That works only on IE.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to calculate height of a text using jquery 3 42
Timer on div 5 24
Rotate images for Web Page 11 28
How to show popup no matter what a user clicks on navigation wise 10 35
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

726 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