title: Capturing all the <a> click event
body: <p>I am thinking of to add a javascript function to capture all the <code>&lt;a&gt;</code> click events inside a html page.</p>
  
  <p>So I am adding a global function that governs all the <code>&lt;a&gt;</code> click events, but not adding onclick to each  (neither using <code>.onclick=</code> nor <code>attachEvent(onclick...)</code> nor inline <code>onclick=</code>). I will leave each <code>&lt;a&gt;</code> as simple as <code>&lt;a href="someurl"&gt;</code> within the html without touching them. </p>
  
  <p>I tried <code>window.onclick = function (e) {...}</code>
  but that just captures all the clicks
  How do I specify only the clicks on <code>&lt;a&gt;</code> and to extract the links inside <code>&lt;a&gt;</code> that is being clicked?</p>
  
  <p><strong>Restriction</strong>: I don't want to use any exra libraries like jQuery, just vanilla javascript.</p>