I was wondering if I need to use the form element in my HTML when I make an Ajax call. Can I just get away with using, for instance, the input element, and then specifying the rest of the information (URL, etc.) in the JavaScript?
By “need,” I mean to say is there some stylistic, security or reliability reason to continue using the <form> element?
If you’re doing an AJAX request, you do not technically need the
<form>tag. However, there are some reasons why you might want to keep using it<form>and submit it with AJAX rather than requiring you to select each<input>element, extract its value, and construct the AJAX request yourself.