JSFiddle - React, Tailwind, and code Playground

HTML

<button type="button" class="btn1">Cancel</button>
<button type="button" class="btn2">Save</button>

JavaScript

$(".btn1").blur(function () {
    alert(this.className);
});
$(".btn2").mousedown(function () {
    alert(this.className);
});