Possible Duplicate:
this.href vs $(this).attr('href')
Here is my code:
$(function () {
$("a.Delete").click(function () {
console.log(this.href);
console.log($(this).attr("href"));
return false;
});
and here is my link
<a class="Delete" href="/Contact/Delete/10402">Delete</a>
Here is my output:
http://localhost:59485/Contact/Delete/10402
/Contact/Delete/10402
Why the difference doesn't the attr method just get the attribute. Isn't that what this.href does? Is the href property special in some way that it actually gives you the absolute url?