Introduction to JavaScript Lesson 1, Step 4: Writing JavaScript in Chrome Developer Tools error
Trying to learn the language, and can’t through the first lesson without an error…
Uncaught TypeError: Cannot read property ‘addEventListener’ of null
at FirstProgram.JS.html:8
<html>
<head>
<title>Intro to Programming JS Lesson 1.4</title>
</head>
<body>
<button id-"say-hi">Say Hi</button>
<script>
document.getElementById("say-hi").addEventListener("click", function()
{console.log("Hi");}
);
</script>
</body>
</html>