I have two tabs
in this code. Now, I want that when window load it shows active class data i.e. id="it_count"
and after change tab
then it will show related data to that tab i.e. id="non_it_count"
. So, How can I do this? Please help me.
<ul class="nav nav-tabs">
<li class="active" id="it">
<a data-toggle="tab" href="#home">IT Jobs</a>
</li>
<li id="non_it"><a data-toggle="tab" href="#menu1">Non IT Jobs</a></li>
<li style="float:right;">
<p id="it_count">Search Result Found <b style="color:red;">[ <?php echo $job_count_it; ?> ]</b></p>
<p id="non_it_count">Search Result Found <b style="color:red;">[ <?php echo $job_count_non; ?> ]</b></p>
</li>
</ul>
<script>
$(document).ready(function(){
if($(".nav-tabs li .it_no").hasClass('active'))
{
$("#it_no").css("display","block");
$("#non_it_no").css("display","none");
}
else
{
$("#non_it_no").css("display","block");
$("#it_no").css("display","none");
}
});
</script>