First, let's create a file with our script.
This file needs the extension
For example, let's name this file
Let's put some code in it:
Now, let's include our script in the HTML file.
To do this, in the tag
script in the
src you need to put the path
to the script file:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script src="script.js"></script> </head> <body> </body> </html>
Make a script file. Include it in your HTML file. Check out its work.