I have a page with different panels, and a function that uses jQuery to show/hide them. I've debugged it for hours, but still can't figure out what's wrong.
JAVASCRIPT:
function toTab(curtab,tname){
console.log('toTab: '+curtab+', '+tname);
$('div.panel#'+curtab).attr('hidden','hidden');
$('div.panel#'+tname).removeAttr('hidden');
};
HTML:
<div class='panel' id='main'>
<div id='rafosd'><h1 id='rafos'>
RafOS<em class='flashing'>_</em>
</h1></div>
<a id='mainl' class='panelchange' href='javascript:toTab("main","signin");'><!-- !!! JS FUNCTION CALLED HERE! !!! !-->Sign in</a>
<script>
setInterval(function() {
$('.flashing').toggleClass('hide');
}, 500);
</script>
</div>
<!-- !-->
<div class='panel' hidden id='signin'>
<div style="display:table;">
<div style="display:table-cell;vertical-align:middle;">
<form id='fsignin' style="margin-left:auto;margin-right:auto;" method='post' action='api/signin.php'>
<h1>Sign in</h1>
<h3 style="color: rgba(165, 165, 165, 1)">— Control your games remotely —</h3>
<input type='text' class='input' required placeholder='Username' autocomplete='off' name='username' id='signin-username'>
<br>
<input type='password' class='input' required placeholder='Password' name='password' autocomplete='off' id='signin-password'>
<br>
<input type='submit' class='button' name='submit' id='signin-submit' value='SIGN IN'><br>
Don't have an account? <strong><a id='signin' class='panelchange' href='javascript:toTab("signin","signup");'><!-- !!! JS FUNCTION CALLED HERE! !!! !-->Sign up</a></strong>
</form>
</div>
</div>
</div>
<!-- !-->
<div class='panel' hidden id='signup'>
<div style="display:table;">
<div style="display:table-cell;vertical-align:middle;">
<form id='fsignup' style="margin-left:auto;margin-right:auto;" method='post' action='api/signup.php'>
<h1>Sign up</h1>
<h3 style="color: rgba(165, 165, 165, 1)">— Control your games remotely —</h3>
<input type='text' class='input' placeholder='Username' autocomplete='off' name='username' id='signup-username'>
<br>
<input type='password' class='input' placeholder='Password' name='password' autocomplete='off' id='signup-password'>
<br>
<input type='submit' class='button' name='submit' id='signup-submit' value='SIGN UP'><br>
Already have an account? <strong><a id='signup' class='panelchange' href='javascript:toTab("signup","signin");'><!-- !!! JS FUNCTION CALLED HERE! !!! !-->Sign in</a></strong>
</form>
</div>
</div>
</div>
NOTE:
If this is too much code and you can't understand it very well, or would like to see only a part/all of the code, the page is live here.Comment if you don't understand something, and I'll do my best to explain.