Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Web Component Example : Just Some HTML

This is a super basic Web Component. All it does is output some HTML.

JavaScript

customElements.define('wc-widget', 
    class Widget extends HTMLElement {
        constructor() {
            super()
            this.attachShadow({ mode: 'open' })
            this.content = document.createElement('div')
            this.content.innerHTML = 'This is a web component'
            this.shadowRoot.append(this.content)
        }
    }
)

Footnotes And References