I have this code I got from a site. It works fine and it can detect a click inside of an iframe.
$('body', $('#iframeId1').contents()).click(function(event) {
alert("Link clicked");
});
However, I am trying to get the href of the clicked link. I tried :
var href = $(this).attr("href");
alert(href);
But this alerts undefined