- $("#content").click(function(event)
- {
- if($(event.target).is('a'))
- {
- $(this).//do something
- }
- }
I'm binding a click event to a div so that I can see whether is was the div or some element inside the div that has been clicked. When the if() in my code evaluates to true $(this) is still equal to $("#content") whereas I'd like to have the clicked anchor as matched element. How would I do this?