I am trying to dynamically create datatables in tabs based on an input and so far I have no problems creating the datatables and tabs. However, when I click on the tab, i cant toggle to the data I want. I have no problems doing it manually like this:
<a href="#tabTable2" data-toggle="tab" class="test"></a>
However, I want to add the "data-toggle" attribute through javascript/jquery and I can't find a way to do it. Anyone has any idea how to overcome this issue or have any workarounds?
This is my code:
var tabHyperLink = document.createElement("a");
tabHyperLink.href = "#tabTable"+x;
tabHyperLink.innerHTML = "Hold "+x;
tabHyperLink.dataToggle = "tab"; //this doesn't work