JSFiddle - React, Tailwind, and code Playground
by Raphael Quintao
HTML
<button is="hide-button">Submit</button>
JavaScript
var btn1 = Object.create(HTMLButtonElement.prototype);
var btn2 = document.createElement("a");
btn1.text = 'Hide Side Bar';
btn1.action = function () {
console.log('Working!');
}
btn1.attachedCallback = function () {
console.log('Ovo', this.text);
};
//console.log(btn1, btn2);
var newBtn = document.registerElement('hide-button', {
extends: 'button',
prototype: btn1
});