I am new to jquery. I have link like this ..
<div>title 1<a href="/delete/1" class="del">Delete</a></div>
<div>title 2<a href="/delete/2" class="del">Delete</a></div>
jquery
$(".del").click(function () {
alert($(this).attr('href'));
event.preventDefault();
});
I am trying to get href attribute. But it says Object object. I am trying to figure out what I doing wrong. How I can fix this.
I appreciate any help.
Maybe try this: