Cannot change title when jQuery tooltip is enabled

Here is the scenario:

  • I create a button using the jQuery button of the widget, and I add a title to it
  • I invoke a jquery hint widget

When I change the name pragmatically, the tooltip is updated correctly, but when I change the title , when I click the button , the title attribute does not change (I checked it on firebug) The following is an example illustrating this use case.

In my example, if you click the [change title] button, it works to see the problem, click [change the title with a delay] and place the cursor on the [theme] button and wait for a warning.

In short, this code does not work when you hover over a button:

$('#div').attr('title', 'new title'); 

It looks very strange to me, can anyone advise?

To be more precise, my question is: why doesn't the title attribute change?

+4
source share
1 answer

Not sure if this is exactly what you want, but you could do this:

 setTimeout(function(){ $(document).tooltip('destroy'); $('#div').attr('title','new title'); $(document).tooltip(); alert('title changed'); }, 2000); }); 

FIDDLE HERE

+3
source

All Articles