Skip to content

Design4 min read

How to Show and Hide Elements on Click in Webflow

Learn how to show and hide elements on click in Webflow with native interactions or JavaScript.

In this tutorial, Sandro, co-founder of the Gemeos Webflow agency, shows you how to show and hide elements on click in Webflow, using native interactions or JavaScript.

Example

Here’s the hidden content. It appears with a smooth animation thanks to max-height and opacity, with no extra JavaScript needed for the animation.
MethodBenefitWhen to use it
Webflow Interactions (Toggle)No code, visible in the DesignerSimple cases, 1 element
JavaScript classList.toggleMore controlMultiple linked elements
CSS :checked (hidden input)No JSAccordions, simple tabs

Method 1: Webflow Interactions

Select the trigger button. In Interactions, create a Mouse click (tap) trigger. Add the Display action to the target element, with the Toggle option. This is the fastest method for a simple case.

Method 2: JavaScript with classList.toggle

For more complex cases (multiple elements, CSS animations), use this approach:

document.querySelector('.toggle-btn').addEventListener('click', function() {
  document.querySelector('.toggle-content').classList.toggle('visible');
  this.classList.toggle('active');
});

With the matching CSS:

.toggle-content { display: none; }
.toggle-content.visible { display: block; }
.toggle-btn.active { background: #333; color: #fff; }

Conclusion

Show/hide on click is one of the most commonly used interactions. Use cases:

  • Show more details on a product card
  • Show/hide an extra form
  • Filter toggles on a listing page

Published on May 19, 2026

Sandro DA SILVA

Growth Marketer, Webflow expert, and jack-of-all-trades. Sandro handles commercial operations, ensures projects run smoothly, and addresses marketing-related issues (SEO, Tracking, Copywriting, etc).

You're going to working with us, guaranteed

Ready to launch your business?

get a quote

Let’s f*****G GO !!