JSFiddle - React, Tailwind, and code Playground
HTML
<input type="button" value="test" onclick="test()">
JavaScript
test = function(){
console.log('test');
}
<input type="button" value="test" onclick="test()">
test = function(){
console.log('test');
}