JSFiddle - React, Tailwind, and code Playground

by Persio

HTML

<p id="test">Test</p>

CSS

html {
    margin: 1em;
}
#test {
    cursor: pointer;
}

JavaScript

function Decorator() {
    this.someProperty = '';
}

Decorator.prototype = {
    someMethod: function() {
         alert('Done');
    }    
};
    
$(function(){
        
    $('#test').live('click', function(){
        //obj.decorator($(this));
        var aw = new Decorator();
        aw.someMethod();
    }
    
    
    $('#test2').live('click', function(){
        //var info = $(this).position().top;
        var info = $(this).decorator();
        //alert(info);
    });
    
});