/*FirstJS.js*/
alert("Hello World!")
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JSPract</title>
</head>
<body>
<!--内部样式-->
<script>
//弹出警示框
alert("Hello World!")
//向body标签写入内容
document.write("<h1>Hello World</h1>")
//向控制台写入日志
console.log("Hello World!")
</script>
<script>
//JS严格区分大小写
let input
input = prompt("Please type message here.")
document.write("The input is:" + input + "<br><br>")
</script>
<!--外部样式-->
<script src="./JS/FirstJS.js"></script>
<!--行内写法-->
<button onclick="alert('Hello World!')">按钮</button>
</body>
</html>