So I am trying to change the visibility of class "feel" and "feels" when user clicks on button "signup" using javascript but I am not getting anywhere. Nothing happens when i click on the button. I have set visibility of class "feels" hidden at first. After user clicks on button it should change to visible and visibility of class "feel" should change to hidden.
document.getElementById("btn").addEventListener("click", function(e) {
signup()
});
function signup() {
document.getElementsByClassName("feel").style.visibility: "hidden";
document.getElementsByClassName("feels").style.visibility: "visible";
}
<div class="feel">
<h2>Be a part of this society to feel.</h2>
<p><a href="">Forgot your password?</a> Doesn't have an account?
<button id="btn" onclick="return(signup());" id="sign">Signup</button>
<form action name="myForm" onsubmit="return(validate());">
<input type="email" required placeholder="Email Address" name="email">
<input type="password" placeholder="Password" name="pass">
<input type="submit" name="submit" Value="Sign In">
</form>
</div>
<div class="feels">
<h1>Please provide the following informations:</h1>
<form action name="form" onsubmit="return(validate1());">
<input type="text" placeholder="Firstname" name="fname">
<input type="text" placeholder="Lastname" name="lname">
<input type="email" placeholder="Email Address" name="email">
<input type="password" placeholder="Password" name="pass">
<input type="password" placeholder="Re-type Password" name="repass">
<input type="radio" name="gender" value="male"> Male
<input type="radio" name="gender" value="female"> Female
<input type="submit" name="submit1" Value="Submit">
</form>
</div>
btnandsign. remove any onedocument.getElementsByClassName("feel")[0].style.visibility = "hidden";