JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" value="Attach #searchbar to the DOM" />

JavaScript

$("#searchbar").live("onOptionsApplied", function () {
    alert("fdafds");
});

$(function() {
    $("input").click(function() {
        $("<div>Attached!</div>").attr("id", "searchbar").appendTo("body");
        $("#searchbar").trigger("onOptionsApplied");
    });
});