案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript" src="/js/jquery.js"></script>
4
<script type="text/javascript">
5
$(document).ready(function(){
6
  $("a").click(function(event){
7
    event.preventDefault();
8
  });
9
});
10
</script>
11
</head>
12
<body>
13
<a href="http://w3xue.com/">W3xue</a>
14
<p>preventDefault() 方法将防止上面的链接打开 URL。</p>
15
</body>
16
</html>
17