I'm trying to print the relative URL from the href shown below in the console:
<div class="span-8 last">
<span class="large">
<a href="/property/3938749">1221 Pearl St.</a>
</span>
</div>
using the following jQuery call:
$(document).ready(function(){
$(".span-8 .large").hover(function(){
var href = $(this).attr("href");
console.log(href);
});
which I believe is essentially what was described here, but when I hover over the selected element, instead of
/property/3938749
the console is showing me
undefined
Any suggestions as to what I'm missing would be greatly appreciated!