SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using a idTabs to build a tab menu and i'm almost there. But how can i add a class when a tab is selected to the li element class=current(which is the parent) if the anchor is class =SELECTED. And when the class in the anchor is SELECTED and element li class is CURRENT i want to remove the current from all other li element

Thanks in advance

$(document).ready(function(){ $("#outer ul").idTabs(); });

<div id="outer">
<ul class="tabby">
    <li><a href="#Home" class="selected">Home</a></li>
    <li><a href="#NewPages">NewPages</a></li>

<div id="NewPages" style="display: none;">
    <ul id="subby_NewPages">
        <a href="" class="selected">
        <a href="">
        <a href="">
        <b>Stores </b></a></li>

<div id="Home" style="display: block;">
    <ul id="subby_Home">
        <a href="" class="selected">
share|improve this question

So the first bit is to find the li you're looking for which in jQuery is done using Selectors. In your case you want a class selector for "selected" and then get the parent object (an li). The selection of a parent is described in this forum post.

Your code will look something like the following

share|improve this answer
Thanks Neil but the link to the forum doesn't exist – Patrick Jan 13 '11 at 23:33… – Neil Richards Jan 14 '11 at 6:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.