Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Javascript code

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want a javascript code that does the following:

When I bring the mouse pointer over a text, that text should change its colour or that text should change to another text. Then the mouse pointer is released earlier state should be recovered!

Please anyone help me. Thank you very much.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps you'd have better luck asking this in our [URL=https://coderanch.com/forums/f-20/HTML-JavaScript[HTML and JavaScript[/URL] forum. Here, I'll move this post there for you.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basic Idea

<span onmouseover="this.innerHTML='bar';this.style.color='red'" onmouseout="this.innerHTML='foo';this.style.color='black'">foo</span>

Eric
 
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Namitha,

This, I think can be handled by the onMouseOverEvent.

I have a working code, but cannot be directly posted here, since there are some character formating, which i am not in a position to do now. Am quite busy.

If you can give me your mail Id, I shall send the code.

The way to handle it is quite simple.

Cheers,
Swamy
 
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic