I am creating a simple tooltip plugin, which shows “title” attribute contents as tooltip text. So I want to disable the default browser behavior of showing the tooltip as I am displaying it in a div. So I used the code below, but this doesn’t work and I can see the default tooltip and my tooltip both together, default tooltip overlaps mine tooltip.
$("a").hover(function(e){
e.preventDefault();
});
Why don’t you just ensure that there are no
altandtitleattributes in the<a>tag.Changes to –
So all you have to do is run this jQuery code on all the
<a>tags you want to remvove the default tooltip behavior on –If you want to maintain those tooltips for use at a later stage, you should save them in the
$.dataobject, and return the values in the second hover function, the “hover out” callback.