title: Using jQuery next() and ignoring nested lists?
body: <p>I'm having a little problem here, I want to use next() but I want to ignore nested lists... how can this be done? Right now next will select both the main list and the nested lists.</p>
  
  <p>So say I have...</p>
  
  <pre><code>&lt;ul id="mainlist"&gt;
  &lt;li&gt;1&lt;/li&gt;
  &lt;li class="selected"&gt;2&lt;/li&gt;
      &lt;ul id="nested"&gt;
      &lt;li&gt;A&lt;/li&gt;
      &lt;li&gt;B&lt;/li&gt;
      &lt;li&gt;B&lt;/li&gt;
      &lt;/ul&gt;
  &lt;li&gt;3&lt;/li&gt;
  &lt;/ul&gt;
  
  $(".selected").next().css("color", "red");
  </code></pre>
  
  <p>In this situation, the entire "nested" list color changes to red. But I would like the "3" to be red... What can I do in this situation?</p>
  
  <p>Any help is appreciated, thank you.</p>
  
  <p>NOTE: This is just an example problem, I'm actually trying to create navigation through list items but figured this code would be easier for an example.</p>