I wrote this code in my html file <button onclick="startGame" class="startBtn">Start</button>
And this in my JavaScript
var start = document.querySelector(".starter");
var game = document.querySelector(".game");
var submit = document.querySelector(".submit");
function startGame() {
start.classList.add("hide");
game.classList.remove("hide");
}
But when I run this it shows the error like this enter image description here
I tried to hide an element and show another with this function. But return the error