The onevent attributes REALLY should be stricken from HTML. They violate the separation of concerns, make it harder to trap the actual event object -- and more importantly event.currentTarget requiring even more bloat in the markup, if used on multiple similar pages it introduced bloat and missed caching opportunities.

It basically is the JavaScript equivalent of outdated attributes like border, align, size, bgcolor, etc. As Indy would say "it belongs in a museum".

Kind of like you're examples, where you abuse placeholder or numbered headings to do LABEL's job, have no fieldsets, start a document with a h4 (aka gibberish semantics), etc, etc, etc...

Would have been nice if you had included a section on the more "proper" way of doing it: addEventListener

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store