JSFiddle - React, Tailwind, and code Playground
HTML
<div id="target">
Click here
</div>
JavaScript
//the function I want to invoke by String
function CheckMe() {
return "haha";
}
//the function that will search for the function and invoke it
function InvokeChecking(fun) {
var fn = fun;
print fn;
if (typeof fn === 'function') {
return = fn(); //invoke the function
}
}
//the event listener ( ´ ▽ ` ).
$("#target").click(function() {
alert("event is working");
//alert(InvokeChecking("CheckMe"));
});