</body>
tag, put a pair of matching script tags to contain your Javascript. <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Section 2: JavaScript Language Basics</title>
</head>
<body>
<h1>Section 2: JavaScript Language Basics</h1>
</body>
<script>
console.log('Hello World!');
</script>
</html>
</body>
tag but this time leave them empty.src
attribute to the <script>
tag pointing to the external JS file you wish to execute.<script src='script.js'></script>
and will look like the code block below.<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Section 2: JavaScript Language Basics</title>
</head>
<body>
<h1>Section 2: JavaScript Language Basics</h1>
</body>
<script src="script.js"></script>
</html>
console.log('Hello World!!!');
Hello World!!!
Rendering context...