alert:控制浏览器弹出一个警告框
document.write():让计算机在页面中输出内容
console.log():向控制台输出一个内容
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>helloword</title>
<!--JS代码需要编写到script的标签中 -->
<script type="text/javascript">
/*
控制浏览器弹出一个警告框
alert("这是我的第一行JS代码");
*/
/* alert("这是我的第一行JS代码"); */
alert(1);
/* 让计算机在页面中输出内容
document.write() 可以向body中输出内容
document.write('你看我')
*/
/* 向控制台输出一个内容
console.log()的作用是向控制台输出内容
*/
console.log("你看我在哪里出来?")
</script>
</head>
<body>
</body>
</html>