Go to page content

toggle_class

Toggle a class from an element.

Example:

{% button action={toggle_class target="myid" class="newclass"} %}

When the HTML element with id "myid" has the CSS class "newclass" then it is removed, otherwise it is added.

See also the actions add_class and remove_class.

This page is part of the Zotonic documentation, which is licensed under the Apache License 2.0.