How To Link JS File In HTML
Last Updated : Jan 1, 2023
Now, in this session we will learn that how we are able to link a js file in html.
Step By Step Guide On How To Link JS File In HTML :-
And first two from them do not generate any external file so that there is no any generation of link to add in html file.
So, the last one that is external js file, in which an external file is created which need to link in html file. But except the concept of linking file, all the work is same in all js file types.
- First, we write <! DOCTYPE html> which we used as an instruction to the web browser about what version of HTML file is written in.
- Secondly, the <html> tag is used to indicate the beginning of an HTML document.
- As above now <head> tag is used to contain information about web page. In this tag a <title> tag is used which helps us to specify a webpage title. Both <head> and <title> tags are Paired tags. So, both have </head> and </title> ending tags respectively.
- Thirdly, <body> tag is used to define the webpage body. All the contents to show on website are written here.
- And you can also use this script tag anywhere in the body, it’s not mandatory to use a top of page and after this you are able to write your html codes as you do.
- At last, the <body> and <html> tags are closed with </body> and </html> respectively.