How to import Javascript code from external file in HTML

If your Javascript code is too big, or just for readability and management purpose, it’s best to include Javascript codes from an external file. This method is also good for re-usability purpose.

The code below will load the Javascript code stored in myscript.js to the calling file.

<script language="JavaScript" type="text/javascript" src="myscript.js">