JavaScript is sometimes referred to as a programming ...

The button is technically not javaScript code – it is HTML code. So it must go in the web page, but not inside your script. The button does, however, call the javaScript function’s name, and, in doing so, makes the function happen. ................
................