Basically I want to add an onClick
event to the single button in each loop. This event would add a class called "Active" or "AlreadyClicked" (whatever). How can I do this using wordpress loops, but without affecting all other buttons on the same page in different loops? I added an image for clarity.
So here's an example:
<?php
while (have_posts()) : the_post();
...
<a class="downloadButton" onClick="downloadSuccess $add_class(Active);">text</a>
...
?>
Is this possible? Also, is it possible to add a session to this so if a user goes to page 2 and then back to page 1, the buttons he's clicked have the appended classes to them?