Scripts in external files

You can store any script in a separate file. The SCRIPT element has an SRC attribute to refer to the file. For JavaScript, the file usually has a JS extension.

<SCRIPT Language="JavaScript" SRC="script1.js">
</SCRIPT>

There are two ways to create an external script file: