How do I collect information about neighbouring element of button?

I’m trying to analyze button clicks. The buttons have no descriptive class or id, but their neighbouring element does. My trigger now fires when a button that is a child of the “example” class is clicked.

Is there any way to configure my tag so that I can catch the class of the span when the button is clicked?

<div class='example'>
   <button></button>
   <span class="this-is-the-information-i-need"></span>
<div>

Hi,

you can get access to the class name via:

{{ Click Element }}.nextElementSibling.className
1 Like