Hiding a ul

Hiding a ul

OK this should be pretty easy (or so I thought!)

I just want to hide the ul that follows the span with the text 'AIRS' in the following html.


I can find the span that contains 'AIRS' with this code ...

$('span:contains("AIRS")').css('background-color', 'red');

But then I try the following and I can't get it to work...


var AIRSsubList = $('span:contains("AIRS")').find('ul');

AIRSsubList.hide();


Any help appreciated

Thanks

P




  1. <div id="zz14_V4QuickLaunchMenu" class=" noindex ms-core-listMenu-verticalBox">
     <ul id="zz15_RootAspMenu" class="root ms-core-listMenu-root static">
      <li class="static">
       <a class="static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" tabindex="0" href="/teamsites/1010ProcessCentreCandD/Pages/default.aspx">
        <span class="additional-background ms-navedit-flyoutArrow">
         <span class="menu-item-text">1010 Process Centre - C&amp;D</span>
        </span>
       </a>
      </li>
      <li class="static">
       <a class="static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" tabindex="0" href="/teamsites/1010ProcessCentreRetail/Pages/default.aspx">
        <span class="additional-background ms-navedit-flyoutArrow">
         <span class="menu-item-text">1010 Process Centre - Retail</span>
        </span>
       </a>
      </li>
      <li class="static">
       <a class="static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" tabindex="0" href="/teamsites/airs/Pages/default.aspx">
        <span class="additional-background ms-navedit-flyoutArrow">
         <span class="menu-item-text">AIRS</span>
        </span>
       </a>
       <ul class="static">
        <li class="static">
         <a class="static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" tabindex="0" href="/teamsites/airs/Pages/News.aspx">
          <span class="additional-background ms-navedit-flyoutArrow">
           <span class="menu-item-text">News</span>
          </span>
         </a>
        </li>
        <li class="static">
         <a class="static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" tabindex="0" href="/teamsites/airs/Pages/FAQs.aspx">
          <span class="additional-background ms-navedit-flyoutArrow">
           <span class="menu-item-text">FAQs</span>
          </span>
         </a>
        </li>
        <li class="static">
         <a class="static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" tabindex="0" href="/teamsites/airs/Pages/WhosWho.aspx">
          <span class="additional-background ms-navedit-flyoutArrow">
           <span class="menu-item-text">Who&#39;s Who</span>
          </span>
         </a>
        </li>
        <li class="static">
         <a class="static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" tabindex="0" href="/teamsites/airs/Pages/Documents.aspx">
          <span class="additional-background ms-navedit-flyoutArrow">
           <span class="menu-item-text">Documents</span>
          </span>
         </a>
        </li>
       </ul>
      </li>
      <li class="static selected">
       <a class="static selected menu-item ms-core-listMenu-item ms-displayInline ms-bold ms-core-listMenu-selected ms-navedit-linkNode" tabindex="0" href="/teamsites/ValuesInPractice/Pages/Home.aspx">
        <span class="additional-background ms-navedit-flyoutArrow">
         <span class="menu-item-text">Values in Practice</span>
         <span class="ms-hidden">Currently selected</span>
        </span>
       </a>
       <ul class="static">