JSFiddle - React, Tailwind, and code Playground

by rodrigonery

HTML

<button id="btn">botao</button>

JavaScript

var TESTE = TESTE || {};

TESTE.objeto = {
    init: function () {
        this.btn = document.getElementById('btn');
        this.btn.onclick = this.handleBtnClick.bind(this);
    },    
    handleBtnClick: function() {
        this.executaMetodo("ola");
    },    
    executaMetodo: function (param) {
        alert(param);
    }
}

TESTE.objeto.init();