页面可以标签引入方法

在html页面中加入js可以用什么方法

编程开发 2020-09-17 02:51:29 43

导读

方法一:在head标签内引入JS文件<html> <head> <script src="此处写你的js文件路径"></script> </head> &……

方法一:在head标签内引入JS文件

<html>
    <head>
        <script src="此处写你的js文件路径"></script>
    </head>
    <body>
 
    </body>
</html>

方法二:在body标签内写JS代码

<html>
    <head>
 
    </head>
    <body>
        <script type="text/javascript">
            //在这里面写你的js代码
        </script>
    </body>
</html


1253067 TFnetwork_cn