title: Javascript get anchor href on click
body: <p>How can I get the href of an anchor when I click on it using javascript?
  I did the following:</p>
  
  <pre><code>function myFunc() {
  }
  window.onclick = myFunc;
  </code></pre>
  
  <p>But how to extend the function to respond only to clicks on anchors and get the href?</p>