title: Pass the destination URL of clicked link to javascript/jQuery
body: <p>After reading <a href="https://stackoverflow.com/questions/6575957/jquery-get-url-from-click-and-pass-to-confirm-button-in-dialog">this Q&amp;A</a> I was able to pass the URL of a specific div to jQuery upon clicking the link. However, I have multiple links of the page and I want to pass their individual href values to jQuery upon clicking. Right now the code selects all links on the page: </p>
  
  <pre><code>jQuery(document).ready(function(){
    jQuery(".view-frontpage a").click(function (event) {
      href = $('.view-frontpage a').attr('href');
      event.preventDefault();
      alert(href);
     });
  });
  </code></pre>
  
  <p>The result of this currently is that it pops up a dialog displaying the href property of the first link on the page, regardless of which link is clicked. How do I change this to give me the href of the link that has just been clicked?</p>