use the dataset on an element.

const el = document.querySelector('.myElement');
el.dataset.bsTheme = 'light';