September 2024
Beginner to intermediate
985 pages
35h 37m
English
JavaScript offers the possibility to submit forms programmatically. For this purpose, the submit() method is available for form objects. In addition, the reset() method can be used to reset the values entered into a form.
To demonstrate the use of these methods, the default submit button from the preceding example has been replaced with two <span> elements in Listing 7.16 (see also Figure 7.5). Listing 7.17 shows how to submit the form by calling the submit() method, and Listing 7.18 illustrates how the values of the form elements can be reset to the default values.
...<body><form id="login" name="login" method="post" action="login.html" class="form col-xs-4 center-block"> <div class=
Read now
Unlock full access