方法一:在head标签内引入JS文件
(推荐教程:html教程)
<html> <head> <script src="此处写你的js文件路径"></script> </head> <body> </body> </html>
方法二:在body标签内写JS代码
<html> <head> </head> <body> <script type="text/javascript"> //在这里面写你的js代码 </script> </body> </html
以上就是在html页面中加入js可以用什么方法的详细内容,更多请关注php中文网其它相关文章!
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号