After reading this Q&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:
jQuery(document).ready(function(){
jQuery(".view-frontpage a").click(function (event) {
href = $('.view-frontpage a').attr('href');
event.preventDefault();
alert(href);
});
});
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?