[jQuery] Click event for anchor tag goes to url in href attribute

[jQuery] Click event for anchor tag goes to url in href attribute


Hi,
I have an anchor tag like <a href="/foo" class="delete" id="1">delete</
a>
I have attached a click event to the tag which does a POST request to
the url by doing
$("a.delete").click(function () {
$.post(url, {"id":id}, function(data){
console.log(data.msg);
});
});
The POST request goes throught, but after that - a GET request goes to
the server because of the link click.
Is there any way to solve this? Is this the right way to do it?