JS&禁用超链接&e.preventDefault(); 阻止事件默认行为


<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>无标题文档title>
        <script type="text/javascript" src="javascript/jquery-1.4.2.js">script>

        <script type="text/javascript">
            $(function() {
                $("a").click(function(e) {
                    //alert("默认行为被禁止喽");
                    e.preventDefault();
                });
            })
        script>
    head>

    <body>
        <a href="1.html">超链接a>
    body>

html>

你可能感兴趣的:(JavaScript)