title: Find the position of an element within a list
body: <p>I'm looking to find the position (i.e. the order) of a clicked element within a list using jQuery.</p>
  
  <p>I have:</p>
  
  <pre><code>&lt;ul&gt;
   &lt;li&gt;Element 1&lt;/li&gt;
   &lt;li&gt;Element 2&lt;/li&gt;
   &lt;li&gt;Element 3&lt;/li&gt;
   ...
  &lt;/ul&gt;
  </code></pre>
  
  <p>On click of an <code>&lt;li&gt;</code>, I want to store it's position within a variable. For example, if I clicked on Element 3, then "3" would be stored in a variable.</p>
  
  <p>How could this be achieved?</p>
  
  <p>Thanks much for your help!</p>