let btn = document.getElementById("btn-login");
let div = document.getElementById("loglog");
let btn2 = document.getElementById("btn-signup");
let div2 = document.getElementById("signMe");
btn.addEventListener("click", () => {
if (div.style.display === "none") {
div2.style.display = "block";
} else {
div.style.display = 'none';
}
})
<div id="loglog">
<form id="wrap">
<img class="userImage" src="user.png" alt="user">
<input id="email" type="text" name="email" placeholder="E-mail">
<input id="password" type="password" name="password" placeholder="Password">
<button id="btn-login" type="button" onclick="login()">Login</button>
<div id="warning-msg"></p>
</form>
</div>
<div id="signMe">
<form id="Create">
<h2>Create Account</h2>
<input id="firstName" type="text" placeholder="First Name">
<input id="lastName" type="text" placeholder="Last Name">
<input id="newEmail" type="text" placeholder="E-mail">
<input id="newPassword" type="password" placeholder="Password">
<button id="btn-signup" type="button" onclick="registerUser()">Sign Up</button>
<div id="warning-msg">
</form>
</div>
Hi expert people, I wanna know how to show the div2(signup button) when I click the div1 (login button) note: the display of div2 in css is "none"; and the login() & registerUser() function is for localstorage not on this problem. thank you.