preventDefault

e.preventDefault()阻止事件默认行为

例如

$("a").click(function (e) {
 

    alert("默认行为被禁止喽");
     e.preventDefault();
});

<a href="http://www.baidu.com">测试</a>

posted @ 2017-03-31 14:06  侠岚之弋痕夕  阅读(174)  评论(0编辑  收藏  举报
Where is the starting point, we don't have a choice, but the destination where we can pursue!