Hello everyone, I wrote a small code for a tooltip
$(function(){ var links = $('a[title]'); links.hover( function(){ var current = $(this); var tooltipText = current.attr('title'); $('div class="tooltip"/div').hide().appendTo(current).text(tooltipText) .fadeIn(500); },function(){ $('div.tooltip').fadeOut(500, function(){ $(this).remove(); }); }); });
One problem arose: the title attribute has not gone away and the browser displays the default tooltip also when you hover over the link. How can I transfer the contents of the second function's tooltipText variable so that the title attribute can be created again? And install it with attr ('title', tooltipText)
The html code is the easiest - just a link with the title attribute, there will be a lot of such links on the page.