"."/> ".">

Home  >  Article  >  Web Front-end  >  How to call javascript files in HTML

How to call javascript files in HTML

青灯夜游
青灯夜游Original
2021-06-28 15:35:182850browse

In HTML, you can use the src attribute of the script tag to call the javascript file. This attribute specifies the URL of the external script file. The syntax format is "6fe72667dc91a8b20b2098e5c999b5c0a68d868d53d9de6b7fe16b14d7e8e543 tag is used to define client-side scripts, such as JavaScript. The

  • 3f1c4e4b6b16bbbd69b2ee476dc4f83a element can either contain script statements or point to an external script file through the "src" attribute.

  • Example:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    </head>
    <body>
    
    <script src="demo_script_src.js" >
    </script>
    
    </body>
    </html>

    Output:

    这个输出的内容来自 JavaScript 外部文件。

    [Related recommendations: javascript learning tutorial]

    The above is the detailed content of How to call javascript files in HTML. For more information, please follow other related articles on the PHP Chinese website!

    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn