class CustomControl extends HTMLElement {
constructor() {
super();
this._internals = this.attachInternals();
this._internals.ariaInvalid = "false";
}
// …
}
window.customElements.define("custom-text", CustomControl);
const element = document.querySelector("custom-text");
console.log(element._internals.ariaInvalid);ElementInternals: ariaInvalid property / notebook
ElementInternals: ariaInvalid property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.