-
The
<script>
HTML element is used to embed executable code - This is typically JavaScript
<script>
HTML element is used to embed executable code
defer
:
This boolean attribute indicates to browser
that the script is meant to be executed after the document
has been parsed, but before firing
DOMContentLoaded.
<head> tags
<body> tag
JavaScript is often placed before the closing body tag to help reduce the page loading time. Doing this allows the rest of the page to load before loading the JavaScript files, which can be large
<script src="javascript.js"></script>
<script type="text/javascript" src="javascript.js"></script>
<script>
alert("Hello World!");
</script>
(scr)ipt
is src