I have a function that runs on load in the body tag. It sets the body elements correctly, but it won't add the 'table-dark' class to a table that is generated dynamically by javascript.
if (darkThemeSelected){
console.log("setting theme to dark");
var element = document.body;
element.setAttribute('data-theme', 'dark');
$('table').addClass('table-dark');}
I tested with a static table and that table get's the added class, but having trouble with the dynamic table.
I've tried moving the function later in the document, and calling it later, but this doesn't seem to care.
Stumped...