I want to select first element .tabs-heading
after last element with these classes .tabs-heading .is-active
And on that first element .tabs-heading
without is-active
class I want to add is-active
class
I've tried this, but not working!
document.querySelector('#next-bt').addEventListener('click', function() {
var firstInactive = document.querySelector('.tabs-heading.is-active:last-child + .tabs-heading');
firstInactive.classList.add('is-active');
});