Solved

Change text with onmouseover/onmouseout

Posted on 2001-08-10
7
156 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
  • 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now