Closing a div using an image.
Hi all,
I just started scripting with jQuery a few weeks ago, and followed several tutorials etc. But there is just one thing bothering me. I want to close a div, using an image just like this:
-
<div id="message">just some text up here <img src="close.gif" id="close"></div>
using this rule of jQuery:
-
$('#close').click(function() {
$('#message').hide();
});
I've also tried a variety of ways to do this,.. but none of them seem to work. Is it possible to close/hide a div using an image or a link placed in the div that's about to close?
Thanks in advance.