class MyAutonomousElement extends HTMLElement {
constructor() {
super();
}
}CustomElementRegistry: define() method / notebook
CustomElementRegistry: define() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
customElements.define("my-autonomous-element", MyAutonomousElement);<my-autonomous-element>Element contents</my-autonomous-element>class MyCustomizedBuiltInElement extends HTMLParagraphElement {
constructor() {
super();
}
}customElements.define(
"my-customized-built-in-element",
MyCustomizedBuiltInElement,
{
extends: "p",
},
);<p is="my-customized-built-in-element"></p>