e.preventdefault()方法阻止元素发生默认的行为(例如,当点击提交按钮时阻止对表单的提交)。

语法:
event
.preventDefault()

参数:
event 必需 规定阻止哪个事件的默认动作。这个 event 参数来自事件绑定函数。

例:
a上面的url将不被打开
$("a").click(function(event){
  event.preventDefault();
});
原文地址:https://www.cnblogs.com/chenxiaomei0104/p/9811024.html