Method 1: Introduce JS files in the head tag
(Recommended tutorial: html tutorial)
<html> <head> <script src="此处写你的js文件路径"></script> </head> <body> </body> </html>
Method 2 :Write JS code in the body tag
<html> <head> </head> <body> <script type="text/javascript"> //在这里面写你的js代码 </script> </body> </html
The above is the detailed content of What method can be used to add js to the html page?. For more information, please follow other related articles on the PHP Chinese website!