Physique Toggle

No Comments

I respect the readability of this trick that Mikael Ainalem posted over on Reddit:

It’s a one-liner that toggles the category on the <physique> so you’ll be able to mock up totally different states and toggle between them on click on.

<physique onclick=”this.classList.toggle(“lively”);”>

Could possibly be on any factor as nicely!

CodePen Embed Fallback

This could be a large factor. See “The Energy of Altering Courses” as a living proof. Even if you happen to aren’t a lot of a JavaScript particular person, classList is maybe the one API it’s best to know.

The put up Physique Toggle appeared first on CSS-Tips. You may help CSS-Tips by being an MVP Supporter.

    About Marketing Solution Australia

    We are a digital marketing company with a focus on helping our customers achieve great results across several key areas.

    Request a free quote

    We offer professional SEO services that help websites increase their organic search score drastically in order to compete for the highest rankings even when it comes to highly competitive keywords.

    Subscribe to our newsletter!

    More from our blog

    See all posts

    Leave a Comment