I need help with hiding and showing tabs on my webpage based on a successful login. I have tried various methods, such as setting the tab to be hidden by default in the HTML code and then using JavaScript to display it upon login. However, none of these methods seem to work as the tab always shows regardless.
Here is a snippet of the relevant code:
Document load method:
$(window).load(
function() {
$("#addEventTab").css("display","none");
$(".loader").fadeOut("slow");
}
}
Login success function:
if (parseInt(response.substr(7,1)) >= 5) {
$("#addEventTab").css("display" , "inline-block");
alert("appearing");
}
HTML code for the tab:
<li role="presentation" id="addEventTab">
<a href="#eventAdd" aria-controls="eventAdd" role="tab" data-toggle="tab">
<i class="fa fa-plus fa-1x">Add An Event</i>
</a>
</li>