Hi,
The jQuery tab I want to do. My goal is to give class active to the tags in <li>.
I want to give the first child class of the tag in li class.
I just couldn't find it. Can anyone help me?
Html
<div class="tabs">
<ul id="tabs-nav">
<li>
<div class="col-xs-12 col-sm-6">
<a href="#1" class="tab-item" type="submit">Selam </a>
</div>
</li>
<li>
<div class="col-xs-12 col-sm-6">
<a href="#2" class="tab-item" type="submit">Merhaba </a>
</div>
</li>
<div id="tabs-content" class="row">
<div id="1" class="tab-content">
<table id="pcmo-table" width="100%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<table style="margin: 5% 2%;">
<tbody>
<tr>
</tr>
</tbody>
</table>
<br>
</td>
</tr>
</tbody>
</table>
</div>
<div id="2" class="tab-content">
<div id="" class="responsive">
</div>
Merhaba
</div>
</div>
<input type="hidden" id="selectedpaymentmethodsystemname" name="selectedpaymentmethodsystemname"
value="Payments.CheckMoneyOrder">
</ul>
</div>
Jquery
<script>
$('#tabs-nav > li:first-child > a.tab-item').addClass('active');
$('.tab-content').hide();
$('.tab-content:first').show();
// Click function
$('#tabs a').click(function () {
$('#tabs a').removeClass('active');
$(this).addClass('active');
$('.tab-content').hide();
var activeTab = $(this).find('a').attr('href');
$(activeTab).fadeIn();
return false;
});
</script>