Custom Elements

suggest change

Syntax

Parameters

Parameter Details
name The name of the new custom element.
options.extends The name of the native element being extended, if any.
options.prototype The custom prototype to use for the custom element, if any.

Remarks

The syntax above is the obsolete v0 API (document.registerElement and createdCallback). The standardized API is customElements.define, with connectedCallback, disconnectedCallback, adoptedCallback, and attributeChangedCallback.

Custom elements let you define HTML tags in JavaScript, with associated styles and behavior. They are often used with Shadow DOM.

Extending Native Elements

Registering New Elements

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents