Tag manager trigger to access parent class in accordion

I’m having trouble configuring my trigger for an accordion component.

I want to fire one tag for opening and one for closing the content. My plan was to use the setting: “Do not run this tag when any of these triggers have been triggered.”.
But since the “Click Event” is fired when clicking on the title and the class holding the open/closed state is on an parent element I’m having some trouble figuring it out.

Here is some pseudo HTML of the current structure:

<div class="expandable expandable--closed"><!-- Want to access class here (expandable--closed / expandable--open) -->
    <h3 class="expandable__heading">
        <button type="button" class="expandable__button">Expandable heading</button><!-- Click event fired here -->
    <div id="1337" class="expandable__content" style="display: none;">
        Expandable content, lorem ipsum sit dolor amet.

Someone got any nifty tricks?

I don’t really understand your needs and your solution…

I suggest you create such trigger:

1 Like

Thanks, that makes sense.

(I’m kind of new to Matomo.)