customElements

The Window.customElements read-only property returns a reference to the CustomElementRegistry object, which can be used to register custom elements, and get information about registered custom elements.

Syntax

customElements = window.customElements

Examples

  class BasicElement extends HTMLElement {
    connectedCallback() {
      this.textContent = 'Just a basic custom element.';
    }
  }
  customElements.define('basic-element', BasicElement);
 

Specification

Document Tags and Contributors

 Contributors to this page: bunnybooboo, arthurevans
 Last updated by: bunnybooboo,