JSFiddle - React, Tailwind, and code Playground
HTML
<a id="test" href="#">test</a>
JavaScript
var counter = 5;
$(document).ready(function(){
$("#test").click(test);
var test = function(e){
console.log(e);
console.log(counter);
counter++;
console.log(counter);
}
});