Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need to create a tooltip message

 
rajkumar sound
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Currently iam using the following code to create a tololtip message when we move the mouse over an icon.

function showHelp() {
document.getElementById("myImage").alt = 'Help';---Not working in firefox
// document.all.elementID.alt = 'Help'; --works only with IE
}

I will call the above function in mouseover event. but the code in the first line is not working in firefox. the code in the second line works only in IE 7?

My question is "document.getElementById("myImage").alt = 'Help'" is not supported in firefox.

IF it is not supported means , what is the equivalent in firefox?

please help me.

Thanks,
RAJ
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64633
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on JSP.

For more information, please read this.

This post has been moved to a more appropriate forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64633
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why aren't you just using the title attribute on the <img> tag? There's no need for any JavaScript to use the HTML-provided tooltips.

P.S. The alt attribute is not the correct way to create tooltips of any kind.
[ October 23, 2008: Message edited by: Bear Bibeault ]
 
rajkumar sound
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great!!!1


It really solves my problem

Thanks,
RAJ
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic