Detect click inside/outside of element with single event handler
<p>Suppose I have one div in my page. how to detect the user click on div content or outside of div content through JavaScript or JQuery. please help with small code snippet.
thanks.</p>

<p><strong>Edit</strong>: As commented in one of the answers below, I only want to attach an event handler to my body, and also want to know which element was clicked upon.</p>
