title: jQuery - find a class exist and return true/false
body: <p>I want to check if class exists inside a child of <code>li</code> and if class exists return <code>true</code> or <code>defined</code>.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;li class="show-more"&gt;
  &lt;a&gt; if found selected then add to this&lt;/a&gt;
  &lt;ul&gt;
  &lt;li&gt;&lt;a&gt; sub-menu&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a&gt; sub-menu&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a class="selected"&gt; sub-menu&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a&gt; sub-menu&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>here is my code, but wont return true or false, it return the url of anchor</p>
  
  <pre><code>var active_sub_menu = $('li.show-more ul li').find('selected');
  
  alert(active_sub_menu);
  if(typeof active_sub_menu == 'defined'){
      $('li.show-more &gt; a').addClass('selected');
  }
  </code></pre>
  
  <p>please dont suggest to use CSS, I just need javascript</p>