I'm trying to write a loop to iterate over each anchor in an unordered list and perform an action on an image inside the anchor. The markup looks like this:
<ul>
<li><a href="#"><img src="image.png" /></a></li>
<li><a href="#"><img src="image.png" /></a></li>
<li><a href="#"><img src="image.png" /></a></li>
</ul>
A click event on any one of the anchors should trigger the loop. I have the following JS so far:
$("a").click(function(){
$("a").each(function(){
if (THIS IS THE CLICKED ON ANCHOR == TRUE) {
// SKIP THIS ITEM
}
else {
$("img",this).actions();
};
});
});
I think I just need the part that skips the item if it is the clicked on anchor, but I'm not apposed to a different approach.
I'm using jQuery 1.3.2.
Thanks!