Linking to an external JavaScript file
suggest change<script src="example.js"></script>
The src attribute works like the href attribute on anchors: you can specify an absolute or a relative URL. The example above links to a file in the same directory as the HTML document. The element is often placed just before </body>, not only in the <head>, so the script does not block rendering. See the JavaScript topic for async and defer.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents