JSFiddle - React, Tailwind, and code Playground

HTML

<div>X</div>
<button id="clear_Button">Clear</button>

JavaScript

var attachEvents = function () {
    $("div").one('click', function (evt) {
        $(this).css("border", "3px solid yellow");
    });
}

$("#clear_Button").click(function () {
    $("div").css("border", "1px solid black");
    attachEvents();
});

attachEvents();