I've looked at other questions of the same type and still can't figure out what's wrong with mine
I'm creating a simple counter app where you can increase or decrease to get better at JavaScript and wanted to satisfy my curiosity on why this is wrong and not working so I can improve my skills.
Here's my html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<script src="script.js" defer></script>
<title>Counter App</title>
</head>
<body>
<div class="container">
<div class="title"><h1>COUNTER APP</h1></div>
<div class="display-center"><h1 class="counter">0</h1></div>
<div class="button-wrapper display-center">
<button class="decrease">-</button>
<button class="increase">+</button>
</div>
</div>
</body>
</html>`
here's my JavaScript
var decrease = document.querySelector("decrease");
var increase = document.querySelector("increase");
var counter = document.querySelector("counter");
var contain = document.querySelector("container");
var count = 0;
decrease.addEventListener("click", () => {
console.log(2);
count--;
counter.innerHTML = count;
console.log(4);
});
increase.addEventListener("click", () => {
count++;
counter.innerHTML = count;
console.log(4);
});