JS中阻止默认事件与事件冒泡

JQuery 提供了两种方式来阻止事件冒泡。

方式一:event.stopPropagation();

        $("#div1").mousedown(function(event){
            event.stopPropagation();
        });

方式二:return false;

        $("#div1").mousedown(function(event){
            return false;
        });
$("a").click(function(event){ event.preventDefault(); });
原文地址:https://www.cnblogs.com/zsongs/p/5304998.html