This is how jQuery toggles work. They can be a pretty useful way of allowing your users to initiate an action. You could hide or show content on click, change the size of an iframe to emulate a mobile device.. The list is endless.

If you’re interested in using this technique, here’s how to do it with Divi.

We’re using the jQuery “addClass” method to append Divi’s #page-container ID with the class “action” whenever an element with the class “custom-action” is clicked. This way we can make changes to any element nested inside of the page container… so everything.

Sent from my Samsung Galaxy smartphone.