i have a jquery function onclick that hides and displays divs:
function toggleInteractlogin(x)
{
if(x=='register')
{
$('#login').hide();
$('#register').show();
}
else
{
$('#register').hide();
$('#login').show();
}
}
However, whenever the page is refreshed the div i am trying to show hides again, is there a way to keep the div displayed after the page has been refreshed.
If you’re using links, have the
hrefbe something like#key, wherekeyis something you can identify and detect on page load (and reload), and auto-show the relevantdivif necessary.If you’re not using a link and instead an
onclickon another element, addlocation.href = "#key";instead.