ElementInternals
The API that lets a custom element behave like a real built-in element rather than a div in disguise.
Three things become possible. Form association: setFormValue() makes the component's value submit with the form, and setValidity() hooks it into ordinary constraint validation so :invalid and error messages work — previously this required a hidden input element behind the scenes. Accessibility: role and ARIA properties are set on the internals object rather than as attributes, which makes them defaults the page author can override rather than attributes fighting the author. And custom states via internals.states, exposed to CSS as :state(loading). Broadly supported since 2023.