how to dynamically add class to a html element code example
Example: dynamically change css class with javascript
document.getElementById('idOfElement').classList.add('newClassName');
document.getElementById('idOfElement').classList.add('newClassName');