JSFiddle - React, Tailwind, and code Playground
by dmethvin
HTML
<p class="hi2">hi2</p>
JavaScript
$.event.special.clickFoo = {
delegateType: "click",
bindType: "click",
handle: function(event) {
event.type = event.handleObj.origType;
ret = event.handleObj.handler.apply(this, arguments);
event.type = event.handleObj.type;
return ret;
}
};
// BAD: Clickable many times
var fn = function(event) {
$(this).append(" world");
};
$(".hi2").one("clickFoo", fn);