js代码写在<script>中
alert 警告
表示提示框
document.write("写在body里");
console.log("写在控制台里");
js会忽略空格与回车
最好句尾加 分号
---------------------------------
语句由上而下执行
标签可以写在 <head> <body>
<!--写在button的onclick属性里-->
<button onclick="alert('hello');">
hit me!
</button>
<!--可以写在a 的href标签里-->
<a href="javascript:alert('hello by a');">hit me too</a>
注: 如果script标签映入了src, 则里面默认不扫描了, 写了也没用