this is js code with some ids from my HTML page
when I press the button with click event the function doesn’t work and the code in the console disappear
let users = [{user:" moh ", password: " 1234 "}, {user:"Jouza", password: "5678"} ]
const name1 = document.querySelector("#Text")
const pass = document.querySelector("#pass1")
const login1 = document.querySelector("#btn")
const paragraph = document.querySelector("#par")
function verify(){
console.log("verify called")
const currentUser = name1.innertext.value
const currentpassword = pass.innertext.value
for(let i = 0; i>users.length; i++){
if( users[i].user === currentUser && users[i].password === currentpassword){
paragraph.innertext="Login Success";
`paragraph.style.backgroundColor="green";`
`return;`
}
}
paragraph.innertext="Login Failed";
paragraph.style.backgroundColor="red";
return;
}
login1.addEventListener("click",verify)