Add html to a div using jQuery and remove it

Adds html to a div on hover and removes it when you mouseout. This was used to create a sort of tooltip for a navigation item.

$('li.nav-item').mouseenter(function() {
    $(this).append( "" );
});

$('li.nav-item').mouseleave(function() {
    $('.nav-message').remove();
});

Leave a Reply

Your email address will not be published. Required fields are marked *

− 7 = 3