title: Get DIV index value
body: <p>I am stuck with a problem here, please help. What my requirement is to get the index value of the div clicked. Have 2 lists, and i need to call a function doSomething(); only when the user clicks the first div set. Is there anyway that i can achieve it.</p>
  
  <p>The scripts and HTML is as follows</p>
  
  <pre><code>$(document).ready(function() {
   $(".list-wrapper li").click(function() {
      var index = $(".list-wrapper div").index(this);
      alert(index);
      });
  });
  
  &lt;div class="list-wrapper"&gt;
  &lt;ul&gt;
  &lt;li&gt;List 1&lt;/li&gt;
  &lt;li&gt;List 2&lt;/li&gt;
  &lt;li&gt;List 3&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;div class="list-wrapper"&gt;
  &lt;ul&gt;
  &lt;li&gt;List 1&lt;/li&gt;
  &lt;li&gt;List 2&lt;/li&gt;
  &lt;li&gt;List 3&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Please help...</p>