How to add a class to just upper element of trigger with Jquery?

Posted by Ahmet Kemal on Stack Overflow See other posts from Stack Overflow or by Ahmet Kemal
Published on 2010-03-11T22:20:51Z Indexed on 2010/03/12 16:57 UTC
Read the original article Hit count: 241

Filed under:
|
|

Hello,

I am working on a Jquery accordion stuff. I want to add a class to the div that contains the accordion trigger <a> tag. You can look at my code. I want to add "first" class name to just first "newsitems" class when clicked "Recession fashion in Japan Video" title.

        <!-- news items starts-->
        <div class="newsitems">
          <h3 class="business"> <a href="#" title="expand"><img src="images/expand_icon.gif" alt="collapse" class="collpase" /> Recession fashion in Japan Video</a> </h3>
          <p class="timestamp">0100hrs</p>
        </div>
        <!-- news items ends-->
        <!-- news items starts-->
        <div class="newsitems">
          <h3 class="sports"> <a href="#" title="expand"><img src="images/expand_icon.gif" alt="collapse" class="collpase" /> Murray survives five-set thriller at Wimbledon</a> </h3>
          <p class="timestamp">0100hrs</p>
        </div>
        <!-- news items ends-->

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about accordion