coderef

Form-associated custom elementsBaseline · Widely available

Custom elements may act like built-in form elements, via the attachInternals() method of HTMLElement and the ElementInternals API.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Mar 27, 2023. Widely available since Sep 27, 2025.

Browser support

DesktopChrome
1–76Not supported
77+Supportedsince Sep 10, 2019
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–97Not supported
98+Supportedsince Mar 8, 2022
Current: 157
Safari
1–16.3Not supported
16.4+Supportedsince Mar 27, 2023
Current: 27
MobileChrome Android
18–76Not supported
77+Supportedsince Sep 10, 2019
Current: 155
Firefox Android
4–97Not supported
98+Supportedsince Mar 8, 2022
Current: 157
Safari iOS
1–16.3Not supported
16.4+Supportedsince Mar 27, 2023
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: ElementInternals.

Feature detection

JS · check before using
if ("ElementInternals" in globalThis && "form" in ElementInternals.prototype) {
  // ElementInternals.form is available
}

Sub-features

Support for each part of the feature (11). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
ElementInternals77799316.4779316.4
ElementInternals.checkValidity77799816.4779816.4
ElementInternals.form77799816.4779816.4
ElementInternals.labels77799816.4779816.4
ElementInternals.reportValidity77799816.4779816.4
ElementInternals.setFormValue77799816.4779816.4
ElementInternals.setValidity77799816.4779816.4
ElementInternals.validationMessage77799816.4779816.4
ElementInternals.validity77799816.4779816.4
ElementInternals.willValidate77799816.4779816.4
HTMLElement.attachInternals77799316.4779316.4