主要两种结合方式 1.内部js 直接在html中引入 <script> alert("Hello"); </script> 2.外部js 新建一个js文件 在文件内输入 alert(“out”); 在html中引用外部js(js文件夹下的a.js文件) <script src="js/a.js"></script> 文章来源: https://blog.csdn.net/qq_43277404/article/details/97284789 标签 js html文件