I'm a bit confused with jQuery's .click() event. I'm trying to use the event on an image inside a span. This is the line of HTML containing the span and image.
<span class="content-message-element"><a href=""><img class="content-message-icon" src="./images/icon_close.png" alt="Close Message" /></a></span>
As you can see, the image has the class 'content-message-icon'. I've used this in my jQuery code (by the way - I have jQuery 1.7.1 included) but nothing happens ; the event is not triggered at all.
Is the .click() event limited to certain types of elements?
<script type="text/javascript">
$(".content-message-icon").click(function() {
alert("Handler for .click() called.");
});
</script>
This is my jQuery, any help is appreciated.
document.readycall before the click function.