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
$("a").click(function(event){
event.preventDefault();
});
event.preventDefault();
});
Prevent a link from opening the URL:
No comments:
Post a Comment