Change Inner Text when logged out

I know i can create say two buttons and show one when logged in and one when logged out.

Can i however just change the inner text and disable the button say when the user is logged out?

Thanks.

Yes you can.
Set up the InnerText or InnerHtml dynamic attribute of the button to show required text based on the value of a variable or cookie which stores login information.
For ex: say variable isLoggedIn has value 1 when logged in, and 0 when logged out.
In the dynamic attribute set value as
isLoggedIn.value == 1 ? 'Log Out' : 'Login'

2 Likes