JSFiddle - React, Tailwind, and code Playground

HTML

<div id="listener">
    <input type="text" id="color" class="color" /> <div class="foo">click me</div>
</div>

JavaScript

$("listener").addEvents({
    "change:relay(input.color)": function() {
        alert("changed!!");
    },
    "click:relay(div.foo)": function() {
        alert("clicked");
    }
});

    
(function() {
    $("listener").fireEvent("change", {target: $("color")});
}).delay(2000);