I have experience with Java and Python and am following along with this tutorial online (https://www.youtube.com/watch?v=W6NZfCO5SIk&t=579s) to learn Javascript. Despite copying and pasting his code (where I have a javascript file called "test.js" and a html file called "test.html", I am unable to have the "Hello world" text displaying in the browser page when it opens. (The title of the page displays correctly, but the "Hello world" text does not display in the page and there is only a blank page).
test.html:
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content = "ie=edge">
<title>Today's date</title>
</head>
<body>
<script src = "test.js">
</script>
</body>
test.js:
console.log("Hello world")
Hello World
` in the ``, your code does something completely different. If you watch further, the video creator explains how to look at the console. – Mar 30 '20 at 12:38Hello World
` is parsed and rendered by the browser and thus displayed in big letters in the main window. `console.log("Hello world")` on the other hand writes `Hello World` to the console. But again: your code and the video's do not match, not the filename, not the content at that timecode. It's like you're following two different tutorials. Also: HTML isn't executed. It's not a programming language. HTML defines content and structure, and that is parsed into a DOM object and rendered to the window. – Mar 30 '20 at 12:45Huge heading test
` and `console.log("I AM CONSOLIO")` so the difference becomes obvious and mistakes are easier to find. – Mar 30 '20 at 12:49