I have a trouble toggling between the login page and register page. So I want a piece of code which will help me shift from - Register Page
to this - Login Page
plz someone help me with the js part here. (only the front-end not the back-end
I have a trouble toggling between the login page and register page. So I want a piece of code which will help me shift from - Register Page
to this - Login Page
plz someone help me with the js part here. (only the front-end not the back-end
You could do something like this with jquery...
html
<div id="loginForm">
LOGIN FORM
</div>
<div id="registerForm" style="display:none;">
REGISTER FORM
</div>
<a href="#" id="toggleLogin" class="toggleRegister" >Register instead</a>
<a href="#" id="toggleRegister" class="toggleRegister" style="display:none"; >Login Instead</a>
javascript
$('document').ready( () => {
$('.toggleRegister').on('click', (e) => {
e.preventDefault;
$('#toggleRegister').toggle();
$('#toggleLogin').toggle();
$('#registerForm').toggle();
$('#loginForm').toggle();
})
});
Kindly check the below code for toggling between login and register pages.