[jQuery] .is() behaviour
[jQuery] .is() behaviour
Hi, I'm new to jQuery, and found something unexpected. With something
like this:
<div id="nav">
<a href="/exit/" class="exit">Exit</a>
<a href="/open/" class="open">Open</a>
</div>
<script type="text/javascript" charset="utf-8">
jQuery('#nav').bind('click', function() {
alert(jQuery(event.target).is('#nav .exit'));
event.preventDefault();
});
</script>
I expect .is('#nav .exit') to return true when the event is fired from
the Exit link, and false otherwise. Instead it always returns true.
What am I missing?
Thanks!