1 <!DOCTYPE html>
 2 <html>
 3 
 4     <head>
 5         <meta charset="UTF-8">
 6         <title></title>
 7         <!--
 8             描述:JS代码需要编写到script标签中
 9         -->
10         <script type="text/javascript">
11             //控制浏览器弹出一个警告框
12             alert("这是我的第一行JS代码");
13             
14             //可以向body中输出一个内容
15             document.write("看我出不出来");
16             
17             //向控制台输出一个内容
18             console.log("你猜我在哪里出来呢");
19         </script>
20     </head>
21 
22     <body>
23     </body>
24 
25 </html>

 

相关文章:

  • 2021-09-19
  • 2022-01-29
  • 2022-02-09
  • 2022-01-09
  • 2021-09-21
  • 2021-05-26
猜你喜欢
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2021-06-22
  • 2021-12-23
  • 2021-04-18
  • 2021-07-16
相关资源
相似解决方案