title: jQuery .click(): get attribute from DIVs with the same class
body: <p>I have a problem with click event; here's the code:</p>
  
  <p>jQuery:</p>
  
  <pre><code>$(document).ready(function() {
      $('.myClass').click(function() {
          alert($(.myClass).attr("iditem"));
      });
  });
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="myClass" iditem="1"&gt;
      1 
  &lt;/div&gt;
  &lt;div class="myClass" iditem="2"&gt;
      2
  &lt;/div&gt;
  </code></pre>
  
  <p>Two <code>DIV</code> with same class, but different values for the same attribute, when I click on a <code>DIV</code>, alert print always "1" (it seems ignoring the declaration of second <code>DIV</code>). Why <code>.attr()</code> doesn't take the right value for the second <code>DIV</code>?</p>