You are viewing a single comment's thread from:

RE: Creating an Animated Hamburger Menu Icon.

I was also very curious about this, that's why I decided to try it out.

In that x.classList.toggle("animate") is the .toggle() method a replacement for both .add() and .remove() methods?

Yes! It sort of switches between those two anytime the icon is clicked and It's very useful in creating toggle buttons.

I'm really glad you found this article useful bro😊.
Thanks a lot for visiting!❤️

Sort:  

Awesome 😁 I only knew about the add and remove methods but this toggle method will sure make things easier, at least I have learnt something new today. Thanks for the wonderful article

You're welcome 😊