Transversing & replacing classes
<p>I wish to replace a class name for a child element (<code>ul</code>) of parent (<code>li.filetabs</code>) element. What I have done seems quite right but it's obviously not as the class is not being replaced.</p>

<p><strong><a href="http://jsfiddle.net/ADesN/" rel="nofollow">UPDATED WITH JSFIDDLE</a></strong>
Note for Jsfiddle: when you click once, it all works, click on the same navigation tab again and you see the drop down disappear and reappear...</p>

<pre><code>var aFileTabs = $('.filetabs');
var curTab = $(this);
// this seems to give correct output 
var prevCurTab = $('.cTabActive').parent(); //(i.e. *jQuery(li.filetabs)*  )
// the following line is the problem line; Ive tried replacing the children with
// $('ul',prevCurTab)... but that doesnt work either... I must be doing something
// very basic wrong
$(prevCurTab).children().removeClass('cTabActive').addClass('cPrevTabActive');
$('ul', curTab).addClass ('cTabActive');
</code></pre>

<p>Edit: Apologies, I forgot the HTML, there is quite a bit more so only the first two navigation buttons html being shown to get the meaning across.</p>

<pre><code>    &lt;div id="filemenu"&gt;                     &lt;!-- right tabs menu --&gt;
        &lt;ul id="fm_ul"&gt;
            &lt;li class="filetabs"&gt;File
                &lt;ul&gt;
                    &lt;li class="m_items"&gt;&lt;a href="#"&gt;&lt;span class="aHeading"&gt;New&lt;/span&gt;&lt;span class="shortcutK"&gt;Ctrl-U&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;li class="m_items"&gt;&lt;a href="#"&gt;&lt;span class="aHeading"&gt;Open&lt;/span&gt;&lt;span class="shortcutK"&gt;Ctrl-Z&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;li class="m_items"&gt;&lt;a href="#"&gt;&lt;span class="aHeading"&gt;Save&lt;/span&gt;&lt;span class="shortcutK"&gt;Ctrl-T&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;li class="m_items"&gt;&lt;a href="#"&gt;&lt;span class="aHeading"&gt;Exit&lt;/span&gt;&lt;span class="shortcutK"&gt;Ctrl-Q&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;&lt;/li&gt;&lt;li class="filetabs"&gt;Edit
&lt;ul&gt;
                    &lt;li class="m_items"&gt;&lt;a href="#"&gt;&lt;span class="aHeading"&gt;Undo&lt;/span&gt;&lt;span class="shortcutK"&gt;Ctrl-M&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;li class="m_items"&gt;&lt;a href="#"&gt;&lt;span class="aHeading"&gt;Redo&lt;/span&gt;&lt;span class="shortcutK"&gt;Ctrl-S&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;li class="m_items"&gt;&lt;a href="#"&gt;&lt;span class="aHeading"&gt;Zoom In&lt;/span&gt;&lt;span class="shortcutK"&gt;Ctrl-R&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;li class="m_items"&gt;&lt;a href="#"&gt;&lt;span class="aHeading"&gt;Zoom Out&lt;/span&gt;&lt;span class="shortcutK"&gt;Ctrl-Q&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;

                &lt;/ul&gt;&lt;/li&gt;
</code></pre>
