Event Bubbling

function logText(e) {
  console.log(this.classList.value);
}

div.addEventListener("mousedown", logText);
one
two
three

Event Capture

function logText(e) {
    console.log(this.classList.value);
  }

div.addEventListener("mousedown", logText, { capture: true });
one
two
three

Event Bubbling (with Stop Propagation)

function logTextWithStopPropagation(e) {
  console.log(this.classList.value);
  e.stopPropagation();
}

div.addEventListener("mousedown", logTextWithStopPropagation);
one
two
three

Event Capture (with Stop Propagation)

function logTextWithStopPropagation(e) {
  console.log(this.classList.value);
  e.stopPropagation();
}

div.addEventListener("mousedown", logTextWithStopPropagation, { capture: true });
one
two
three

Once

function logText(e) {
  console.log(this.classList.value);
}

div.addEventListener("mousedown", logText, { once: true })
one
two
three