Categories
JavaScript Answers

How to link a JavaScript file to a HTML file?

Spread the love

To link a JavaScript file to a HTML file, we add a script element.

For instance, we write

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

to add the script element to load jQuery in our HTML code.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *