JSFiddle - React, Tailwind, and code Playground

by davestein

HTML

<input type="button" value="Yell" id="yell" /><br /><br />

JavaScript

var Obj = {
  
    yelled : 0,
  
    yell : function( e ) {
     
       ++this.yelled ;
        $('body').append('I have yelled '+this.yelled+' times<br />');
        if ( e && e.target ) {
          console.log( e.target );
        }
      
    }
    
};

Obj.yell();
$('#yell').bind( 'click', $.proxy( Obj.yell, Obj ) );