I have this simple app where I'm tyring to trigger a function inside Javascript module by pressing a html button but it seems to do nothing. I looked at another thread about this same topic but does not seem to work for me. As soon as I take the type="module"
off from the script tag it works so it propably has something to do with that. Console gives no errors so I have no idea what I'm doing wrong here.
index.html
<body>
<button id="test">Click me!</button>
<script type="module" src="/app.js"></script>
</body>
app.js
document.getElementById("test").addEventListener("click", () => {
console.log("Hello!");
});