How to prevent link click default action or form submission (jQuery)

If you want to change link click default behavior, you could use jQuery for this purpose. 

Let's assume we have a link:

<a href="/link" id="example-link">Link</a>

jQuery code, which will prevent link click default action:

$('#example-link').click(function(e) {
//your code

The key thing here is the e parameter, which is passed to the function and the e.preventDefault()  


No comments yet, you can leave yours: