To add JavaScript code to a webpage, we start with the <script>
and </script>
tags.
<body>
<script></script>
</body>
The script
element is the last element before the closing </body>
tag in the HTML structure.
<body>
<h3>Tweeter</h3>
<script></script>
</body>
In the HTML file, JavaScript like const username = "Lee";
only works if placed inside the script
element.
<body>
<h3>Tweeter</h3>
<script>
const username = "Lee";
</script>
</body>