Those tutorials are getting out of date.
Just looking at one example of submitting a form, the problems are:
- inline event attributes and inline scripting are used, whereas traditional scripting events (or even advanced ones) are now the favored technique
- Script is in the head, whereas we now put our scripts at the bottom
- A button is used to trigger the script to submit the form, whereas a standard submit button should be used instead
In fact, their example code can be completely replaced with HTML only code, no scripting. Their scripting example provide no benefit over standard techniques.
Actually, their scripted form example completely fails to work at all when scripting is not available. This surprizingly means that an HTML-only solution is superior in practice to their script coded example. Not a good look.
Most of their other code examples face similar "out of date" problems too.
w3schools used to be a good resource, but it has long since been surpassed by the passage of time and circumstance.