CustomElementPrototype : HTMLElement
The prototype used for a custom element created with
customElements.define()
.Instance Methods
attributeChangedCallback(name : String, oldValue : Object, newValue : Object, namespace : String) : undefined
Called when an attribute was changed on the element. See also MutationObserver.
Example:
RunResults:
connectedCallback() : undefined
Called when the custom element is inserted into the document or when the prototype is applied to elements already in the tree at the time customElements.define()
is called. See also MutationObserver.
Example:
RunResults:
disconnectedCallback() : undefined
Called when the element is removed from the document. See also MutationObserver.
Example:
RunResults:
Details
The following example demonstrates how to create a custom element based on HTMLElement.
Example:
RunResults:
Copyright © JavaScripture Contributors