<form> element has two important attributes:
actionis a URL that will process the form submission. In this case, it is
methodis the HTTP method to submit the form with. Typically, it is the
postmethod sends data to the server as the request body while the
getmethod appends the form data to the action URL with a
HTMLFormElement object. The
HTMLFormElement has the following corresponding properties:
action– the URL that will process the form data. It is equivalent to the HTML action attribute
method– can be
post, which is equivalent to the HTML method attribute.
HTMLFormElement element also provides the following useful methods:
submit()– submit the form.
reset()– reset the form.