Do you need to have a seperate css class for each list item?
If they all visually look the same, I would have only 2 classes, one for the selected element, and one for all other elements. If this was the case you could do something like this: $('.unselected').click(function(){ $('.selected').attr('class','unselected'); $(this).attr('class','selected'); }); Eddie Peloke wrote: > > > I have the following code. Basically, when the home_sel anchor is > clicked, I want to change the class to "home select" and have all > other li elements have select removed if they have it turned on...I'm > having problems getting this to work properly in jQuery. How can I do > this? > > Thanks! > > > <div id="tabs"> > <ul > > <li class="home select"> # Home </li> > <li class="packages"> # Packages </li> > <li class="test_drive"> # Test Drive </li> > <li class="sign_up"> # Sign up </li> > > </ul> > </div> > > > -- View this message in context: http://www.nabble.com/changing-class-tf4281741s15494.html#a12188647 Sent from the JQuery mailing list archive at Nabble.com.