title: How to access all child <li> elements in a list in jquery?
body: <p>For example, I have a html code that looks like the following:</p>
  
  <pre><code>&lt;ul id="li1"&gt;
    &lt;li&gt;a&lt;/li&gt;
    &lt;li&gt;b&lt;/li&gt;
    &lt;li&gt;c&lt;/li&gt;
    &lt;li&gt;d&lt;/li&gt;
    &lt;li&gt;e&lt;/li&gt;
    &lt;li class="class1"&gt;f&lt;/li&gt;
    &lt;li&gt;g&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I want to traverse through each of the <code>&lt;li&gt;</code> element and check whether it has a specific class "<code>class1</code>". I am looking for something that look like (python-equivalent):</p>
  
  <pre><code>for i in $("#li1").children():
      print i.hasClass("class1")
  </code></pre>
  
  <p>I couldn't find a way to evaluate each of the child <code>&lt;li&gt;</code> element in javascript or jquery. Can someone help?</p>