let customElementRegistry = window.customElements;
customElementRegistry.define("my-custom-element", MyCustomElement);Window: customElements property / notebook
Window: customElements property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
customElements.define(
"element-details",
class extends HTMLElement {
constructor() {
super();
const template = document.getElementById("element-details-template");
const shadowRoot = this.attachShadow({ mode: "open" }).appendChild(
document.importNode(template.content, true),
);
}
},
);