<div id="first">
            外层
            <span id="second">
                内层
            </span>
        </div>
        <script type="text/javascript" src="js/jquery-3.1.1.min.js" ></script>
        <script>
            $("#first").click(function(){
                console.log("外层")
            })
            $("#second").click(function(event){
                event.stopPropagation(); 
                console.log("内层")
            })
        </script>

 

posted on 2019-03-28 09:50  song.yan  阅读(836)  评论(0编辑  收藏  举报