Skip to main content

customElements.define() and lifecycle callbacks

Autonomous custom elements: registration, upgrade and the connected, disconnected and attributeChanged callbacks. Specification: html.spec.whatwg.org/multipage/custom-elements.html.

Results​

Probed on 2026-10-19 with Node.js v22.23.3.

warpdom 0.1.6​

Supported

3 of 3 checks work.

Web IDL existence (coverage):

Report a wrong result for warpdom

happy-dom 21.0.3​

Supported

3 of 3 checks work.

Web IDL existence (coverage):

Report a wrong result for happy-dom

jsdom 30.1.3​

Supported

3 of 3 checks work.

Web IDL existence (coverage):

Report a wrong result for jsdom

linkedom 0.18.13​

Supported

3 of 3 checks work.

Web IDL existence (coverage):

Report a wrong result for linkedom

Checks​

Exists when: window.customElements.define is a function.

  • connected-disconnected: connectedCallback runs on insertion into the document and disconnectedCallback on removal. (spec)
  • attribute-changed: attributeChangedCallback(name, old, new) runs for attributes listed in observedAttributes only. (spec)
  • upgrade: An element parsed before define() is upgraded when its definition arrives; whenDefined() and get() see it. (spec)