JS-01-js的三种引入方式

 1 <!DOCTYPE html>
 2 <html>
 3     <head>
 4         <meta charset="UTF-8">
 5         <title></title>
 6         <style type="text/css">
 7            div{
 8               width: 200px;
 9               height: 200px;
10               background: #000;
11            }
12         </style>
13     </head>
14     <body>
15        <!--嵌入式-->
16         <script>
17             //单行注释
18             /*
19              * 多行注释
20              * */
21             alert('js hello world!');//弹窗
22         </script>
23         
24         
25         <!--外链式-->
26         <!--注意:如果script标签外部引入js文件,
27             那么此标签当中就不能再写js程序-->
28         <script src="../test.js"></script>
29         
30         
31         
32         <!--行间式-->
33         <div onclick="alert('yea...行间样式生效了')"></div>
34         <a href="javascript:alert('我是a');">点我</a>
35         <a href="javascript:void(0)" onclick="alert('我也是a');">再来点我啊</a>
36     </body>
37 </html>

 

转载于:https://www.cnblogs.com/qinqin-me/p/11259430.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值