JSFiddle - React, Tailwind, and code Playground
by filmgrvin
HTML
<button id='btn'>
Click Me!
</button>
JavaScript
function Student(name, uni) {
this.name = name;
this.uni = uni;
this.displayInfo = function() {
return this.name + ' attends ' + this.uni;
}
}
let btn = document.getElementById('btn');
btn.onclick = function() {
let george = new Student('george', 'MIT');
console.log(george.displayInfo());
}