Where JS code
- Those look just like usual HTML elements, and they can be placed in the head or the body section.
- For most cases, the best place to include the script tags will be at the body element’s end.
- In this case, the script tag will serve as a link to that file.
<body> <!-- html --> <script src='js/scripts.js'></script> </body>
- The message passed through the alert function is shown on a popup
alert('Sending a message via alert');
- The message sent through the console.log function can be seen on the browser’s inspector.
console.log('Sending a message via the console');