I am making a website that will keep online records of the users gaming data. But my problem comes in here:
The user can create an account, if they dont have one, or login to an existing one.
<a href="login.aspx">Login</a> <a href="" id="loginstate"></a>
Now my link tag with the id "loginstate" value will either be "Create Account" if the there arnt any cookies for the website on the users computer. Or it will be "Log out" if the user is logged in. That information I can change, by using this javascript code:
function changeLoginMenuText()
{
if (isLogedIn == false)
{
document.getElementById("loginstate").innerHTML = "Create Account";
}
else if (isLogedIn == false)
{
document.getElementById("loginstate").innerHTML = "Logout";
}
}
But now the href="" data should also change, so how do I change that data?