I'm new to jQuery and I'm trying to solve this little problem here.

Imagine that I have the following code:

<ul class="pageitem">

<li class="menu">
<a href="#music"><span class="name">Music list</span><span
class="arrow"></span></a>
</li>

<li class="menu">
<a href="#album"><span class="name">Album list</span><span
class="arrow"></span></a>
</li>

<li class="menu">
<a href="#song"><span class="name">Song list</span><span
class="arrow"></span></a>
</li>

</ul>

So now when I click one of the links I want to be able to change the
class of the span that contains the arrow class.

How can I know which link was clicked so that I can change the correct
class and not all of them?

Some like this should change the class of every link on the list
correct (sorry, I can't try this right now)?

 $(document).ready(function() {
   $(".pageitem > li > a > span.arrow").addClass("testing");
 });

Thanks for your help

Tiago

Reply via email to