title: How to get the index of an <li> in a <ul>
body: <blockquote>
    <p><strong>Possible Duplicates:</strong><br>
    <a href="https://stackoverflow.com/questions/2048718/how-to-get-index-of-li-element">How to get index of &lt;li&gt; element</a><br>
    <a href="https://stackoverflow.com/questions/3204349/jquery-get-the-index-of-a-element-with-a-certain-class">jQuery - get the index of a element with a certain class</a>  </p>
  </blockquote>
  
  
  
  <p>I have:</p>
  
  <pre><code>&lt;ul id="parent"&gt;
       &lt;li id="li1"&gt;li1&lt;/li&gt;
       &lt;li id="li2"&gt;li2&lt;/li&gt;
       &lt;li id="li3"&gt;li3&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>There are some other <code>&lt;ul&gt;</code> and <code>&lt;li&gt;</code> tags elsewhere. </p>
  
  <p>I want to get the index of <strong>li2</strong> which is in the <code>&lt;ul&gt;</code> with id <strong>parent</strong> using jQuery</p>