Can you send data without using a
You'll at least want some of the basic user experience that people expect with forms. For example, if you build an interactive form without using a
<form> tag, users will expect hitting enter to submit the form. This is important for keeping pages accessible, and will also make for better user experiences overall for many different types of users.
"No problem, I'll just add an event listener to listen for the enter key!" Excellent that you're considering keyboard users. Don't forget to test out your implementation, though. Here's a checklist:
You'll periodically want to run through this checklist again in case any new built-in form functionality comes out with browser updates, or updates to assitive tools.
Or, you could just use a
<form> tag. Why reinvent the wheel when the platform has put all this thought in for us already?
In my opinion, this is always a good strategy: Use the platform.