This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes OnMouseover Change text color. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "OnMouseover Change text color." Watch "OnMouseover Change text color." New topic
Author

OnMouseover Change text color.

Patricia Samuel
Ranch Hand

Joined: Sep 12, 2007
Posts: 300
Hello All,

I have a tag

& lt;span on mouse over="callfunction" class="text"& gt;textstring
& lt;/span& gt;



I want to change "textstring" color whenever user mouse over on it.can anyone help me to sort out this petty problem.

And also , i am getting some problem in posting this topic. It shows me some html related tag problems. I appreciate if some one could tell me how to post HTML code.


Thanks to All.
Have a Good Day!

-Patricia
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Originally posted by Patricia Samuel:

& lt;span on mouse over="callfunction" class="text"& gt;textstring
To invoke a function as an event handler:
And also , i am getting some problem in posting this topic

For security reasons, the forum code will filter out certain JavaScript phrases. The phrase "eval" and most of the "onwhatever" event attributes will trigger the filter.

To get around the filter, substitute the HTML entity for some characters in the phrase. For example, o for 'o'.
[ February 24, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

P.S. If you are only concerned with modern browsers, you can do this with CSS and no JavaScript.
 
 
subject: OnMouseover Change text color.
 
Similar Threads
change CSS rules dynamic with JavaScript
tag text bgcolor to change
Using CSS Class for Mouse Rollover text
Images on Images using CSS
problem with onmouseout in NN7