views:

259

answers:

2

I have a page with two links. On each, I've attached a JavaScript onmouseover event. I require a tooltip to be displayed when the mouse encounters a link, and require that it should not disappear until I point the mouse at the other link.

The problem is that I create table at runtime, and I want to display tooltips for the table cells as well. If only I could just write:

Response.Write("td onmouseover=tootip()").

...but sadly, it is not to be. So please, tell me: how can I attach mouseover events to the cells of a dynamically-created table?

+1  A: 

If you know the ID or class name of you item, just use jQuery. All jQuery functions are added after page load (document.ready).

More about jQuery here: http://docs.jquery.com/How%5FjQuery%5FWorks

UPDATE
Here's an example.

jQuery(document).ready(function() {

  $('#MyTableID td').mouseover(function(){
     // Do whatever you want here.
  });
});
Steven
And why did my suggested answer get -1?
Steven
Steven Kindly reply for the edited request
ROHAN CHAVAN
I have answered your question and it is a valid answer. It's but one of many solutions. If it's not the one you are looking for, then just wait for the correct answer to show up. But don't down vote an answer because of your incompatibility to formulate a good and understandable question, or your lack of knowledge to understand the answer given.
Steven
+1  A: 

How about just using the TITLE element, which gets displayed as a tooltip in many browsers? This does the automatic show on mouseover and hide on mouseout...?

Creating tooltips with the HTML title attribute

JBRWilkinson