<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<!-- 外链式,推荐使用 -->
<script src="js/hello.js"></script>
<!-- 内嵌式,部分推荐使用 -->
<script>
alert("hello world*2!");
</script>
</head>
<body>
<!-- 行间事件,不推荐使用 -->
<div onclick="alert('hello world*1!')">这是一个div</div>
</body>
</html>