JSFiddle - React, Tailwind, and code Playground

by jstenkvist

HTML

<button type="button" id="test">Click</button>

JavaScript

document.getElementById("test").addEventListener('click', first);

function first(e){
    e.stopImmediatePropagation();
    this.removeEventListener("click", first);
    document.onclick = second;
}
function second(){
    alert("I'm not suppose to appear after the first click, only the second.");
}