jquery click toggle class

Posted on 2011-10-07
Last Modified: 2012-05-12

Hello Experts,

i have this very simple code which basically add class to the ul list when its clicked.
when the user click on any of the other list i want to remove the class. currently it stays highlighted though i clicked on the next list.

$('#faq_collection li a').click( function() {

Open in new window

Question by:Refael
    LVL 81

    Accepted Solution

    $('#faq_collection li a').click( function() {

    Author Closing Comment

    thank you so much!

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
    JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now