The event.preventDefault() method stops the default action of an element from happening.
For example:
Prevent a submit button from submitting a form
Prevent a link from following the URL
//Prevent a link from opening the URL:
$("a").click(function(event)
{
event.preventDefault();
});
Syntax
event.preventDefault()