News for hackers. Stuff that matters.
Re:If Web Components are so great, why am I not using them? by dpweb on Wednesday August 02, 2023 @07:09PM (#36979135)
Can be reduced

    customElements.define('like-button', class LikeButton extends HTMLElement {
        connectedCallback() {
            this.innerHTML = '<button></button>'
            this.addEventListener('click', this.onClick, true)
        }
        onClick() {
            this.innerText = 'You liked this'
        }
    })

There are no comments on this comment yet.