JSFiddle - React, Tailwind, and code Playground
HTML
<div id="test">Click Me</div>
CSS
#test{
border: 1px solid;
padding: 10px;
display: inline-block;
cursor: pointer;
}
Babel + JSX
const makeLog = function(e) {
console.log(e.data);
};
const makeObj = function() {
this.logMe = (target, msg) => {
$("#"+target).click(msg, makeLog);
}
};
const myObj = new makeObj();
myObj.logMe("test", "hello");