Introduction to Forms
In the code:
Other than action and methods, there are the following useful methods also which are provided by the HTML Form Element
The syntax of using the getElementById() method is as follows:
Using the Id, we can make the reference.
Submitting the form
Next, we need to submit the form by submitting its value, for which we use the onSubmit() method. Generally, to submit, we use a submit button that submits the value entered in the form.
The syntax of the submit() method is as follows:
Let's collect and use all these to create a Login form and SignUp form and use both.
The output of the above code on clicking on Login button is shown below:
The output of the above code is shown below: