JQuery事件e参数的方法preventDefault()取消默认行为

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(function () {
$("a").click(function (e) {
alert($(this).text());
e.preventDefault();//取消默认行为,没有这句话的话,,会跳转到baidu网站上
});
});
</script>
</head>
<body>
<a href="http://www.baidu.com">baidu</a>
</body>
</html> 
原文地址:https://www.cnblogs.com/zhuiluoyu/p/4661520.html