Some advocate putting the SCRIPT tags in the BODY section, right at the end. Like this:
For the most part, though, we'll place our script tags in the HEAD section of the HTML. Like this:
In the code above, we have added the following attribute to the opening SCRIPT tag:
Note the new extension - js. When saving code in an external file, end the file name with the two letter extension js.
The file itself is this:
Move your alert message to an external file. Make sure you get the file referencing part right after the SRC attribute, otherwise your code won't run properly.
In the next lesson, we'll take a look at the Browser Object Model.