Tabbed DataTables Question

Tabbed DataTables Question

zgoforthzgoforth Posts: 493Questions: 98Answers: 2

Link to test case: https://jsfiddle.net/BeerusDev/ku4hcwfp/99/

Hello,

I am using tabbed DataTables, and was trying to figure out how to change the page title based off of which table is active, I have the following, but it does not work as expected:

if(document.getElementById('tab-table1').active == true){
     document.getElementsByTagName('title')[0].innerText = "Current Task Dashboard";
   alert("Current Tasks is active");
}
if(document.getElementById('tab-table2').active == true){
     document.getElementsByTagName('title')[0].innerText = "Completed Task Dashboard";
   alert("Current Tasks is active");
}

Answers

  • kthorngrenkthorngren Posts: 20,145Questions: 26Answers: 4,736
    edited September 2021

    Not sure what this has to do with Datatables. You are using Bootstrap tabs. Take a look on Stack Overflow for techniques to get the active Bootstrap tab.

    Kevin

Sign In or Register to comment.