220061
Well-Known Coder
hello I'm really new at javascript and I'm trying to get better at it but right now I'm running into a problem? and because I don't really understand java I have no idea what this means.
the error is on the continueBtn
uncaught typeerror cannot read properties of null (reading 'queryselector')
if it helps here is my html
JavaScript:
// er zit hier een probleem die ik maar niet kan vinden hij snapt namelijk continue btn niet
//code voor de signup form tags
const form = document.querySelector(".signup form"),
//code voor de button continue
continueBtn = form.querySelector(".button input");
form.onsubmit = (e)=>{
e.preventDefault(); //preventing from form submitting
}
//functie voor de button
continueBtn.onclick = ()=>{
let xhr = new XMLHttpRequest();
xhr.open("POST", "php/signup.php", true);
xhr.onload = ()=>{
}
xhr.send();
}
the error is on the continueBtn
uncaught typeerror cannot read properties of null (reading 'queryselector')
if it helps here is my html
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">
<title>Realtime applicatie tutorial</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="wrapper">
<!--Dit is een login form -->
<section class="form singup">
<header>Realtime chat app</header>
<form action="#">
<div class="error-txt"> This is an error message!</div>
<div class="name-details">
<div class="field input">
<label>First Name</label>
<input type="text" placeholder="First Name">
</div>
<div class="field input">
<label>Last Name</label>
<input type="text" placeholder="Last Name">
</div>
<div class="field input">
<label>Email</label>
<input type="text" placeholder="Email">
</div>
<div class="field input">
<label>Password</label>
<input type="password" placeholder="Enter password">
<i class="fa fa-eye" aria-hidden="true"></i>
</div>
<div class="field image">
<label>Select profile picture</label>
<input type="file"> <!--Dit zet bestand kiezen op de pagina-->
</div>
<div class="field button">
<input type="submit" value="Continue to chat">
</div>
</div>
</form>
<div class="link">Heb je al een account? <a href="#">Login</a></div>
</section>
</div>
<script src="javascript/pass-show-hide.js"></script>
<script src="javascript/signup.js"></script>
</body>
</html>