Like stated in this example, I can show or hide some form elements that are in a specific group, based on the selected item in a combo box.
What I would like to do, is to maintain the same behavior but using links. For example, the first group is:

If I click on Join us, I would like to switch (to show) to the second group (and hide the first), like this:

.. cyclically.
A basic HTML:
<div id="registrate" class="group1">
<form action="#" method="post" class="regform">
<h1><span class="log-in">Log in</span> or <span class="sign-up">sign up</span></h1>
<p class="float group1_opts">
<input type="text" name="nickname" id="nickname" placeholder="Username or Email..">
</p>
<p class="float group2_opts">
<input type="text" name="nickname" id="nickname" placeholder="Email..">
</p>
<p class="float group2_opts">
<input type="text" name="nickname" id="nickname" placeholder="Confirm Email..">
</p>
<p class="float">
<input type="password" name="password" placeholder="Password.." required><br/>
</p>
<p class="float group2_opts">
<input type="password" name="password" placeholder="Confirm Password.." required><br/>
</p>
<p>
<div class="remember">
<input type="checkbox" name="remember" value="None" id="remember">
<label for="remember"></label>
</div>
<label for="remember" class="remembermelabel">Remember Me</label>
</p>
<p class="submit">
<div class="button">
<input type="submit" name="submit" value="Login">
</div>
</p>
<h1></h1>
<p class="change_link group1_opts"> Not a member yet?
<a href="" class="to_register">Join us</a>
</p>
<p class="change_link group2_opts"> Are you just a member?
<a href="" class="to_login">Login</a>
</p>
</form>
A basic CSS:
.group1_opts, .group2_opts {
display: none;
}
.group1 .group1_opts, .group2 .group2_opts {
display: block;
}
There is a way to obtain this using links instead of combobox, like in the other example? Thank you
.toggle()on the anchor element?.toggle()has been deprecated so I'd stay clear of it.