JSFiddle - React, Tailwind, and code Playground

webcomponents 1

by Csaba Hellinger

HTML

<my-button></my-button>

JavaScript

class MyButton extends HTMLElement {

    constructor() {
        super();
        const button = document.createElement('button');
        button.innerText = 'hello';
        this.appendChild(button);
    }

}

window.customElements.define('my-button', MyButton);