I read some AJAX-Form tutorial like this. The tag form is used in HTML code. However, I believed that it is not necessary. Since we send HTTP request through XmlHttpRequest, the sent data can be anything, not necessary input in form.
So, is there any reason to have form tag in HTML for AJAX application?
Apart from progressive enhancement as already discussed (don’t make your site require JavaScript until it really has to), a
<form>withonsubmitwould be necessary to reliably catch an Enter keypress submission.(Sure, you can try trapping keypresses on separate form fields, but it’s fiddly, fragile and will never 100% reproduce the browser’s native behaviour over what constitutes a form submission.)