<body onclick="alert(1)">
<div id="app" onclick="alert(10)">
    <p onclick="alert(100)">一个p标签</p>
</div>

<script>
    var p = document.getElementsByTagName("p")[0];
    p.onclick = function (event){
        alert(100);
        // 阻止冒泡
        event.stopPropagation();
    };

    var app = document.getElementById("app");
    app.onclick =  function (event){
        alert(10);
        event.stopPropagation();
    }

    var body = document.body;
    body.onclick =  function (){
        alert(1);
    }

</script>