JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test">click</div>

JavaScript

var foo=1,bar=2;
$('#test').on('click',function(){
    test($(this),foo,bar);
});
function test(elem,arg1,arg2){
   console.log(arg1 + ' and ' + arg2);
    console.log(elem);
    elem.css('color','red');
}