how to toggle class in children element
/* HTML
<div id=”menuIcon” onclick=”menuAnimate()”>
<div class=”bar”></div>
<div class=”bar”></div>
<div class=”bar”></div>
</div>
*/
// Javascript
menuAnimate = () => {
const main = document.getElementById('menuIcon');
main.classList.toggle('rotate');
let c = document.getElementById('menuIcon').children;
c[0].classList.toggle('rotateL');
c[1].classList.toggle('slick');
c[2].classList.toggle('rotateR');
}