How to call js in html? In order to make the website have many special effects, many people use js to add special effects in html. So how to reference js files, and what are the methods for introducing external js files into html? Let's summarize how to introduce js into html.
#How to introduce js into html?
In HTML, there are two ways to introduce js, including directly introducing external js, writing js code in the html page and adding js through dom. The introduction of js is in order. Different reference orders may cause different effects, and of course it depends on the actual situation.
1.Introduce external js files on the html page
Syntax:
2. Write js code directly in the page. This method is also the most commonly used method.
Grammar:
The above is a complete introduction to how to introduce js into HTML, if you want to know more For Html5 tutorial, please pay attention to php Chinese website.
The above is the detailed content of How to introduce js into html. For more information, please follow other related articles on the PHP Chinese website!