JSFiddle - React, Tailwind, and code Playground
HTML
<script>
class NoteController { // The controller class
constructor() { // Initialization
// ...
alert('constructor called');
}
static CreateNote() { // The method to call - static
// ....
alert('create note');
}
}
//var nc=new NoteController();
//console.log(nc);
</script>
<button type="button" id="btnCreateNote" onclick="NoteController.CreateNote()">Create</button> // call the method