Is it possible to use the variable type “DOM Element” relative to the clicked element?
If the page looks like this for example:
<div class="wrapper">
<div class="box">
<p>
Some Text
</p>
<button class="myButton">My Button</button>
</div>
<div class="box">
<p>
Some different Text
</p>
<button class="myButton">My Button</button>
</div>
</div>
And I use the DOM Element variable like this:
CSS Selector: .wrapper .box p
It will always gives me the text of the first p
in this case “Some Text”. Doesn’t matter what button I click.
I would like to get the text relative to the button I clicked.
So when I click on the second button I would like to have “Some different Text” stored in a variable.
Is that somehow possible?