title: Iterate through elements, adding click event to each of them
body: <p>jQuery newbie here.</p>
  
  <p>If I have this html:</p>
  
  <pre><code>&lt;ul id="floor-selector"&gt;
      &lt;li id="floor-1"&gt;Ground Floor&lt;/li&gt;
      &lt;li id="floor-2"&gt;Second Floor&lt;/li&gt;
      &lt;li id="floor-3"&gt;Third Floor&lt;/li&gt;
      &lt;li id="floor-4"&gt;Premier Floor (Premier Floor)&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I want to add a <code>click</code> event to each <code>li</code> item, such that I can get the <code>id</code> of the element I am on. Right now I just have an alert with the index I'm on (and it's not working either), but I really want the ID of the item I'm on, not the index of the array returned by my selector.</p>
  
  <p>Here's what I tried, but it doesn't seem to work, I think I might have the wrong understanding of <code>each()</code> or <code>click()</code>.</p>
  
  <pre><code>$('#floor-selector li').each( function(index, node) {
      node.click( function(){ alert('I am on the '+index+'th element'); } );
      // but I really want to get the ID of this element
    });
  </code></pre>