Reputation: 49384
I am trying to have some text added to a Div where I can add some text if the image is hovered and disappear when mouse is out.
I'm trying this:
<script>
$('#image1').mouseover(function() {
$('#panel').append('<div>This image is very nice.</div>');
});
</script>
Upvotes: 1
Views: 1575
Reputation: 230316
You should try this:
$('#image1').hover(function() {
$('#panel').append('<div>This image is very nice.</div>');
}, function() {
$('#panel').empty();
});
Upvotes: 3