JS的引入方式
1 直接编写<script>console.log('hello js')</script>2 导入文件<script src="hello.js"></script>
注释
// 单行注释/*多行注释*/
示例
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Title</title><style></style><!-- 引入外部css --><link rel="stylesheet" href=""><script>// js 的代码alert("hello alvin!")</script><!-- 引入外部js --><script src="index.js"></script></head><body></body></html>
