<div class="page-content">
<div class="content-block">
<div id="tab-holder" class="buttons-row">
<a href="#tab1" class="tab-link active button">Tab 1</a>
<a href="#tab2" class="tab-link button">Tab 2</a>
<a href="#tab3" class="tab-link button">Tab 3</a>
</div>
</div>
</div>
How can I dynamically add tabs to the tab holder?
<a href="#tab1" class="tab-link active button">Tab 1</a>
I tried creating a function, but it doesn't seem to be working:
function createTabButton(_holder, _text, _isActive) {
var thm = $(`<a class="tab-link button ${_isActive ? 'active' : ''}">${_text}</a>`);
_holder.append(thm);
console.log(_text);
}
Do you see anything I might have missed?