How add JavaScript
Element <script> defines a client-side script (JavaScript).
JavaScript code can be in separate file or embeded as content of the script element.
By default script element is hidden from user.
Main attributes src, type, defer, async
See also element noscript.
<script src="/js/jquery-3.4.1.min.js"></script>
<script src="my_async.js" async></script>
<script>
hljs.initHighlightingOnLoad();
</script>
<noscript>Your browser does not support JavaScript!</noscript>
Attribute src
The src attribute specifies the URL of an external script file. It is useful if you want run same code on several pages.
Attribute type
The type attribute specifies the media type of a script. Since HTML 5 default value is "application/javascript".
Attribute defer
The defer allows to execute an external script when the page has finished parsing. Such script never block page.
The async attribute must not be present. The src attribute must be present.
Attribute async
The async allows you to asynchronously execute an external script as soon as it becomes available.
The deffer attribute must not be present. The src attribute must be present.
Element noscript
Element noscript defines an alternate content for users that have disabled scripts in their browser or have a browser that doesn't support script. The content inside the noscript element will be displayed if scripts are not supported, or are disabled.