?
Solved

Change text with onmouseover/onmouseout

Posted on 2001-08-10
7
Medium Priority
?
166 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 14

Accepted Solution

by:
avner earned 400 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…
Suggested Courses

770 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