JavaScript can be placed in the <head> section, in the <body> section, or in an external file.
<script> tag in the HTML file.js file linked with <script src="">Best Practice: Use external JS files to keep code organized and reusable.
Edit the code below and click Run to see the result live.