title: jQuery first element of type click
body: <p>I am working through an issue where I have a menu that is mutli levels deep. I am trying to get it so that if a first level element is clicked (add class <code>.ubermenu-active</code>) it will look for any other first level element with that class and remove it.</p>
  
  <pre><code>$('.ubermenu-item-level-0 span').on('click',function() {
      var target = $('.ubermenu-item-level-0');
      $('.ubermenu li.ubermenu-item-level-0').removeClass('ubermenu-active');
      target.parents('.ubermenu li.ubermenu-item-level-0').toggleClass('ubermenu-active');
  });
  </code></pre>
  
  <p>HTML (mock):</p>
  
  <pre><code>&lt;ul class="ubermenu"&gt;
      &lt;li class="ubermenu-item-level-0"&gt;
          &lt;a class="ubermenu-target"&gt;
              &lt;span class="ubermenu-target-title"&gt;Level 1&lt;/span&gt;
          &lt;/a&gt;
          &lt;ul class="ubermenu-submenu"&gt;
              &lt;li class="ubermenu-item-level-1"&gt;
                  &lt;a class="ubermenu-target"&gt;
                      &lt;span class="ubermenu-target-title"&gt;Level 2&lt;/span&gt;
                  &lt;/a&gt;
              &lt;/li&gt;
              &lt;li class="ubermenu-item-level-1"&gt;
                  &lt;a class="ubermenu-target"&gt;
                      &lt;span class="ubermenu-target-title"&gt;Level 2&lt;/span&gt;
                  &lt;/a&gt;
                  &lt;ul class="ubermenu-submenu"&gt;
                      &lt;li class="ubermenu-item-level-2"&gt;
                          &lt;a class="ubermenu-target"&gt;
                              &lt;span class="ubermenu-target-title"&gt;Level 3&lt;/span&gt;
                          &lt;/a&gt;
                      &lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
          &lt;li class="ubermenu-item-level-0"&gt;
              &lt;a class="ubermenu-target"&gt;
                  &lt;span class="ubermenu-target-title"&gt;Level 1&lt;/span&gt;
              &lt;/a&gt;
          &lt;/li&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Right now if any of the sub elements are clicked the parent closes</p>