How to access an external javascript file that is stored externally and not embedded?

This can be achieved by using the following tag between head tags or between body tags.

<script src=”abc.js”></script>

where “abc.js” is the external javscript file to be accessed.

To access an external JavaScript file that is stored externally and not embedded, you can include it in your HTML document using the <script> tag with the src attribute pointing to the URL of the external JavaScript file.

Here’s how you do it:

html
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
</head>
<body>

<!-- Include the external JavaScript file -->
<script src="https://www.example.com/path/to/external.js"></script>

</body>
</html>

In this example:

  • The <script> tag is used to include the external JavaScript file.
  • The src attribute specifies the URL of the external JavaScript file.
  • You replace "https://www.example.com/path/to/external.js" with the actual URL of your external JavaScript file.

This way, when the HTML document is loaded in the browser, it will also fetch and execute the external JavaScript file.