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

Specification Status Comment
HTML Living Standard
The definition of 'window.customElements' in that specification.
Living Standard Initial definition.

Browser compatibility

Feature Firefox (Gecko) Chrome Edge Internet Explorer Opera Safari
window.customElements No support (Yes) No support ? ? ?
Feature Firefox Mobile (Gecko) Chrome for Android IE Mobile Opera Mobile Safari Mobile
window.customElements ? ? ? ? ?

Document Tags and Contributors

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