JSFiddle - React, Tailwind, and code Playground

HTML

<div id="target">not clicked</div>

JavaScript

$("#target").click(function() {
    $(this).text("clicked");
});

var e = new $.Event("click");
// stopping the propagation (bubbling) *before* the event is triggered won't call any handlers
e.stopPropagation();

$("#target").trigger(e);

// Expected: only the handlers on the #target element are triggered