I am trying to create a working login interface with javascript. I've put down my code but it won't work and it does not show any type of error messages. Thanks Taris
function loginFunction() {
var x = document.getElementById("myText");
var y = document.getElementById("myText1");
console.log(x);
console.log(y);
if (x == "Tom" && y == "Halo") {
window.open("www.youtube.de");
}
}
const button = document.getElementById("button");
button.addEventListener('click', () => {
loginFunction();
});
<input type="username" id="myText" value="Tom">
<input type="password" id="myText1" value="Halo">
<button id="button">login</button>