How do you create a jQuery if statement that checks if a div is clicked, and if so do one thing. If not, do another action?
Current jQuery
$("#button_a").click(function() { $("#div_a").hide(); });
else if #button_a was not clicked, then do something else
If I understand your question correctly, you can take advantage of event bubbling by registering your
clickevent handler on the document and using event.target to determine the element that initiated the event. Something like: