New: Cookbooks and AI ExplanationsStep-by-Step recipes to solve problems connected to Roadmaps and Cheat Sheets. Need more details? Use AI buttons for structured and simple explanations with concrete examples throughout the whole platform.Take a look
I extended HTMLButtonElement so my fancy button would keep the native button's keyboard and form behavior for free, and it silently does nothing once that same page loads in Safari.
What you'll have at the end
A written decision, autonomous or customized built-in, backed by the one browser that never plans to support the other kind
You need
A native HTML element you want to give new behavior to (a button, a list, an input), plus a class ready to extend either a blank base class or that element's own native one.
Not covered
Writing the class's own internal behavior once a kind is picked, and building a polyfill for a customized built-in you decide to keep despite the gap.
Make a custom element form-associated so it submits like a native field
once the rule points to autonomous but you still want the native form submission a customized built-in would have given for free
Fix a shadow-DOM input that won't take focus from its label with delegatesFocus
once the autonomous version has its own shadow root, for wiring a label's click back to the real control inside it
Checked 25 Aug 2026
Part of the Web Components cookbook