I'm setting up a script for modal, however an unexpected error occurred, the console says:
Uncaught TypeError: loginBtn.addEventListener is not a function '"," at modalsGeneral (index.html: 233) "and" at index.html: 235 ",
How can I fix it?
function modaisGeral(){
var principalModal = document.querySelector("modais");//Recebe um elemento
var loginBtn = document.querySelectorAll(".login-modal-open");//Recebe um array de elementos
var loginModal = document.getElementById("login-modal");//Recebe o modal de login
loginBtn.addEventListener("click", function(){});
}modaisGeral();