Reblogged by slightlyoff@toot.cafe ("Alex Russell"):
ryantownsend@webperf.social ("Ryan Townsend") wrote:
Today I learned you can build your own custom form elements which will validate/serialize upon submission, just like native HTML inputs [1]
Support for the ElementInternals interface landed in Chrome & Firefox years ago, and finally in the latest Safari (16.4) but there's a polyfill if you need backwards compatibility [2]
[1]: https://web.dev/more-capable-form-controls/
[2]: https://github.com/calebdwilliams/element-internals-polyfill