dynamically add and remove css class using javascript code example
Example 1: es6 add and remove class
let el = document.getElementById('container');
//remove class
el.classList.remove('first');
//remove class
el.classList.add('first');
Example 2: add and remove class in jquery
$('#toggle li').on('click', function () {
$(this).toggleClass('open')
});