I am trying to figure out how to get javascript to work with html in a separate file so that I can follow this tutorial https://www.w3schools.com/howto/howto_css_modals.asp and I'm having trouble getting my alert to pop up.
Here is my code.
So far I've only been able to get a button that doesn't do anything.
var hellobutton = document.getElementById("hello");
hellobutton.onclick = function() {
alert("Hello World")
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="/static/main.css">
<script type="text/javascript" src="/static/main.js"></script>
<title>Title</title>
</head>
<body>
<div class="content-section">
<h1>Page</h1>
<input type = "button" id="hello" value = "Say Hello" />
</div>
</body>
</html>
The code works here but not on my computer.