Below is the HTML code snippet in question:
<a class="btn test-btn test-btn-1">
<span>Content 1</span>
</a>
This particular code block appears multiple times on the page. The number at the end of test-btn- is dynamically generated, so it could vary from 1 to 200.
Upon clicking the button, an AJAX function is triggered which adds a new class called test-btn-clicked to the a tag. Once the process is complete, I aim to update the content within the span element to display a different message.
I have attempted several methods to achieve this, but the issue I'm facing is that every button's content gets updated, instead of just the one I clicked.
Can anyone provide guidance on how to approach this problem?