Solved

Change text with onmouseover/onmouseout

Posted on 2001-08-10
7
157 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JS Plugin 4 29
validation, if text area is typed or pasted into 2 25
SharePoint 2013 List with Ratings 6 32
Apply tab index in forms 6 33
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

912 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

18 Experts available now in Live!

Get 1:1 Help Now