JSFiddle - React, Tailwind, and code Playground

HTML

<a id="owner" href="javascript: document.getElementById('owner').focus(); doThis();" >ClickOnMe</a>

CSS

body { height: 300px; }
#owner {display: inline; }

JavaScript

function remove() {
    console.log("removed");
  
}

function doThis() {
    console.log("started");
    smile = document.activeElement;
    console.log(smile);
    smile.onblur = function() { remove(); };
    
}