title: Selecting jQuery First Child without a specific class
body: <p>I have a page with nested divs being used as Js/Jq tabs. When you click on a parent tab, it fires the click event of the first child underneath the parent.</p>
  
  <pre><code>$('#topRow .pricing').click(function () {
      $('#secondRow .pricing').css('display', 'block');
      $('#secondRow .pricing div.tab:first-child').trigger('click');
  });
  </code></pre>
  
  <p>This functionality works great as is. However, we're adding functionality to effectively "lock" tabs by adding a "locked" class dynamically via c#/linq and then on window.ready we unbind all the tabs with the "locked" class and color them grey to indicate that they are disabled.</p>
  
  <p>I'm trying to modify the last line of the jQuery code above to click the first child that DOESN'T have the "locked" class.</p>
  
  <pre><code>    $('#secondRow .pricing div.tab:first-child').trigger('click');
  </code></pre>
  
  <p>Translating that into plainspeak, it's saying "In the Second Row, fire the click event of the first child tab in the 'pricing' group". I'd like it to say "In the Second Row, fire the click event of the first child tab in the 'pricing' group that DOES NOT have the class 'locked'".</p>
  
  <p>I've tried using:</p>
  
  <pre><code>    $('#secondRow .pricing div.tab:not(.locked):first-child').trigger('click');
  </code></pre>
  
  <p>Which seems the correct way to do this, but it still looks at the first child and just doesn't fire the trigger('click'). Am I missing something?</p>
  
  <p>Here is the html:</p>
  
  <pre><code>&lt;div id="topRow"&gt;               
      &lt;div class="pricing tab" runat="server" id="pricingTop"&gt;
          &lt;div class="tabLeft"&gt;
              &lt;div class="tabMain"&gt;
                  Pricing
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div id="secondRow"&gt;    
      &lt;div id="pricingTabGroup" runat="server" class="pricing tabGroup" style="display:none"&gt;
          &lt;div id="pricingProductA" runat="server" class="tab locked pricingProductA"&gt;
              &lt;div class="tabLeft"&gt;
                  &lt;div class="tabMain"&gt;
                      ProductA
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div id="pricingProductB" runat="server" class="tab pricingProductB"&gt;
              &lt;div class="tabLeft"&gt;
                  &lt;div class="tabMain"&gt;
                      ProductB
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The "locked" class is added through C#:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      bool ProductA = //some linq query
  
      if (!ProductA)
      {
          LockTab(pricingProductA);
      }
  
      protected void LockTab(HtmlGenericControl tab)
      {
          //Adds the "locked" class
          tab.Attributes.Add("class", "locked");
      }
  }
  </code></pre>