The "script" tag is connected to external JavaScript
With the development of the Internet, more and more websites are beginning to use JavaScript to enhance user experience and interactivity. JavaScript can be written within the "
Among them, the "src" attribute points to the path URL, tells the browser which JavaScript file to load. It should be noted that the path of the script file should be relative to the HTML file. For example, if the JavaScript file is in the same directory as the HTML file, you can set the path to "./script.js".
In addition, the "
The above code will be executed when the page is loaded, and "Hello, World!" will be output to the page.
To summarize, the main way to connect to external JavaScript is to use the "