A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/getName below:

CustomElementRegistry: getName() method - Web APIs

CustomElementRegistry: getName() method

Limited availability

The getName() method of the CustomElementRegistry interface returns the name for a previously-defined custom element.

Syntax Parameters
constructor

Constructor for the custom element.

Return value

The name for the previously defined custom element, or null if there is no custom element defined with the constructor.

Examples
class MyParagraph extends HTMLElement {
  constructor() {
    let templateContent = document.getElementById("custom-paragraph").content;
    super() // returns element this scope
      .attachShadow({ mode: "open" }) // sets AND returns this.shadowRoot
      .append(templateContent.cloneNode(true));
  }
}

customElements.define("my-paragraph", MyParagraph);

// Return a reference to the my-paragraph constructor
customElements.getName(MyParagraph) === "my-paragraph";
Specifications Browser compatibility

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3