customElements

This article needs a technical review. How you can help.

This article needs an editorial review. How you can help.

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);
<basic-element></basic-element>

Specification

Document Tags and Contributors

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