Use .mouseenter
. It works just fine. DEMO
$('#userNameLabel').mouseenter(function() {
$(this).css('display','none');
});
Or if you want to use .on
. DEMO
$('#userNameLabel').on('mouseenter', function() {
$(this).css('display','none');
});