I use the same classes for my elements, but I change the id.the id is unique
<div class="buttons">
<a href="" class="wanted" id="'.$status_id[$num].'">
<img src="/images/wanted.png">
</a>
<a href="" class="unwanted" id="'.$status_id[$num].'">
<img src="/images/unwanted.png">
</a>
</div>
I am trying to reference the unwanted.png to change it in jquery when the class wanted is clicked.
I use var x = document.getElementById(id); to get .wanted, but I cannot figure out how to get .unwanted without using the $(this) reference.
Any help will be super useful.
When you click on one of the links, get its sibling:
Demo