<script></script> tag and include it in the HTML file.
We can place the
<script></script> tag in the
<body> section of an HTML file, as shown in the image below:
However, if we run different functions, it is best to put the
<script></script> tag in the body section before the
</body> closing tag. This ensures that the webpage loads faster.
In the example below, we create files in the
src folder with the
<script src="src/app.js"></script> in the
</body> section of our HTML file before the
closing tag. Let’s look at an example below:
<html> <head> </head> <body> Hello World <script src="src/app.js"></script> </body> </html>
View all Courses