JSFiddle - React, Tailwind, and code Playground

HTML

<div id="box"></div>

CSS

#box{
    width: 100px;
    height: 100px;
    background-color: #add8e6;
}

JavaScript

var box = document.getElementById('box');
 box.addEventListener('click',function(ev){
     alert('----捕获阶段----');
    // ev.preventDefault();
 },true);

 box.addEventListener('click',function(ev){
     alert('----冒泡阶段----');
 },false);