title: Jquery Catching clicking of links outside a specific div
body: <p>I need to catch the event when a user clicks a hyperlink outside of a specific <code>div</code> element. To demonstrate :</p>
  
  <p>If I have this HTML :</p>
  
  <pre><code>&lt;a id = "1" href="/someurl.."&gt;link&lt;/a&gt;
  &lt;a id = "2" href="/someurl.."&gt;link&lt;/a&gt;
  &lt;a id = "3" href="/someurl.."&gt;link&lt;/a&gt;
  
  &lt;div id="content"&gt;
     &lt;a id = "4" href="/someurl.."&gt;link&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I need to catch the event where the user clicks every hyperlink outside of the <code>div</code> with <code>id</code> of "content". But ignore the event when the links inside the <code>div</code> "content" is clicked. </p>
  
  <p><strong>------------------UPDATE----------------</strong></p>
  
  <p>Someone suggested I include what i'm trying to achieve to add clarity. And what the best way to do this is the question.</p>
  
  <p>My use case is that, I have a div where some operations (links) such as sort, edit etc is being utilized. While links outside are links that redirects to other pages. I want to make a confirm modal using bootbox if a user navigates away. I could use the unload but it also fires when I click on the edit,sort operations (links inside the div).</p>
  
  <p>Thanks!</p>