Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hide title attribute on hover, but don't remove
$(".element").hover(function(){
// Get the current title
var title = $(this).attr("title");
// Store it in a temporary attribute
$(this).attr("tmp_title", title);
// Set the title to nothing so we don't see the tooltips
$(this).attr("title","");
});
$(".element").click(function(){// Fired when we leave the element
// Retrieve the title from the temporary attribute
var title = $(this).attr("tmp_title");
// Return the title to what it was
$(this).attr("title", title);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment