• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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
 
He's my best friend. Not yours. Mine. You can have this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic