JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<body>
<div data-global-id="168" class="remove-as-favorite">
remove as favorite
</div>
</body>
</html>
JavaScript
$(function(){
$('.remove-as-favorite').on('click',function(){
var global_id=$(this).data('global-id');
alert('here i am in something: ' + global_id);
event_handler.remove_as_favorite.call({global_id:global_id});
});
event_handler = {
remove_as_favorite: function() {
alert("here i am global_id:" + this.global_id);
}
}
});