JavaScript code can be stored in separate files with the .js extension. Using external files is
a recommended practice, especially for larger projects. To include an external JavaScript file, use the
src attribute in the <script> tag:
<script src="fileName.js"></script>
An external JavaScript file can be included in the <head> or <body> section of an HTML document. Important points to remember:
External JavaScript files can be referenced in three ways:
<script src="https://vadnica.org/js/script.js"></script>
<script src="/js/script.js"></script>
<script src="script.js"></script>