The .work .item
element – that is, the this
inside the handler, is the <div>
, not the <a>
. To navigate to the child <a>
, do:
var href = this.children[0].href;
Or if you prefer the jQuery syntax
var href = $(this).children().attr('href');
CLICK HERE to find out more related problems solutions.