I used the same way for the close sign up form and it worked but with the sign in form it is not working any one knows what the issue could be ?
function openSignInForm(){
document.getElementById('loginform').style.display="block";
}
function closeSignInForm(){
document.getElementById('loginform').style.display="none";
}
<div id=loginform >
<form method="post" action="loginForm.php">
<?php include('errors.php'); ?>
<div class="col-md-12">
<label for="username" class="form-label">Username</label>
<input type="text" name="username" class="form-control" >
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control" name="password" >
</div>
<div class="d-grid gap-2">
<div class="btn-group" role="group" aria-label="Basic mixed styles example">
<button class="btn btn-outline-success" name="login_user">Log In</button>
<button class="btn btn-outline-success" onclick="closeSignInForm()">Close</button>
</div>
</div>
</form>
</div>
the openSignInForm button works but the close one is not working. The div containing the form is displayed none so by default it is hidden until the user clicks the button.