- It makes your life easier.
- Semantics (and the accessibility that happens as a result).
submit event on the
<form> element to keep things not only simpler, but also a lot more usable and accessible.
His post was inspired by a question posted by Coding Journey on Twitter:
Question: If we are preventing default behavior of form submission and manually handle it (e.g. with Fetch API), is there a reason to use the <form> tag? (other than form submission with enter/return key…)
I’d say that you needn’t look further than that last sentence. There’s so many poorly designed forms out there built by developers who doesn’t know any better (seriously, I’ve seen forms in the wild that are nothing more than
Ok, so long story short — learn the basics, use proper forms.