<h2 class="add-class">Element</h2>
.add-new-class{
background:#8864F4;
}
var element = document.querySelector('.add-class');
setTimeout(()=>{
js_util.u_addClass(element, 'add-new-class');
js_util.u_style(element, [{ color: 'white' }, { fontSize: 36 }]);
},1400)
View Compiled
This Pen doesn't use any external CSS resources.