JSFiddle - React, Tailwind, and code Playground
HTML
<input id ="click" type="button" value = "Click"/>
<span id = "showInfo"></span>
JavaScript
var user = {
name: "A",
age: "35",
showInfo: function(){
$("#showInfo").text("This is" + this.name + "-" + this.age + "years old" )
}
}
$("#click").click(user.showInfo);