Find the current
class from following, whichever data attribute tab has class and add append the current
class to similar ID in below div
with tab-content
<a class="projects_select tab-link" data-tab="tab-1" href="#tab1"> tab1 </a>
<a class="projects_select tab-link current" data-tab="tab-2" href="#tab2"> tab2 </a>
<a class="projects_select tab-link" data-tab="tab-3" href="#maps"> tab3 </a>
I have following div's
having tab-content
class.
<div class="tab-content" id="tab-1">Tab-1 </div>
<div class="tab-content" id="tab-2">Tab-2 </div>
<div class="tab-content" id="tab-3">Tab-3 </div>
tried:
$(document).ready(function($) {
$('.projects_select').find('current').attr(data-tab);
$('.tab-content').addClass('current');
});