JSFiddle - React, Tailwind, and code Playground
by adardesign
HTML
<ele data-callback="app.property.init"></ele>
JavaScript
var app = {
property:{
init:function(){
}
}
}
$("ele").on("click", function(){
var callback = $(this).attr("data-callback");
if($.isFunction(callback)){ // need a way to see if the string "app.property.init" is a function.
window[callback](); // the context of this property.
}
return false;
});