I am using a ‘Login’ call to action javascript
button. The button code has a value called Login
. So the button is always displaying the Login
text as a button name all time.
But I want, when any user logged in the site then this button name will be changed and all users will see the button name as Log Out
. If someone click on the Log Out
button then he will logged out.
I want-
- Logged out users/visitors will see the button name ‘Login’
- Logged in users will see the button name ‘Log Out’ with log out action.
Can you please fix by editing my code?
See my current code below:
<input type="button" style="background-color: red" value="Login" data-reveal-id="tmpl_reg_login_container" href="javascript:void(0);" onclick="tmpl_login_frm();"><aside id="sidebar-contact_page_sidebar" class="sidebar large-3 small-12 columns">
Thanks.
you can try
Try this