Skip to main content

Show a popup when an element has a specific CSS class

How to use the "element has a CSS class" targeting condition to show a popup only when a specific CSS class is present on the page. Available on Pro plan and above.

The "element has a CSS class" condition lets you show a popup only when a specific CSS class is present on the page.

⚠️ This feature is available on the Pro plan and above.

When to use this

On pages where the URL does not change when tabs are switched (e.g. landing pages that use JavaScript to toggle content), standard URL conditions cannot filter by tab state. Use this feature to target a specific tab's active state.

How to set it up

  1. Open the Rules tab and go to "Which pages to show on."

  2. Select "Multiple URLs & advanced targeting."

  3. Add the "Element has a CSS class" condition.

  4. Enter the CSS class name applied to the element when it is in the active state.

How to find the CSS class name

Open your browser's developer tools (press F12 in Chrome), right-click the target element and select "Inspect," then look for the class="..." attribute.

Important note

This condition checks for the class at the moment the trigger fires. If you want the popup to appear immediately when a tab is clicked, a custom trigger (JavaScript) is more reliable.

Did this answer your question?