<div>
  <button type="button">
    warning
  </button>
</div>

<script>
  document
    .querySelector('div')
    .addEventListener(
      'click',
      () => window.alert('捕获阶段'),
      {
        capture: true
      },
    );
  
  document
    .querySelector('div')
    .addEventListener('click', () => window.alert('冒泡阶段'));
</script>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.