title: Can get id from clicked class, but not class from clicked id
body: <p>Here is the jsfiddle for what I was testing <a href="http://jsfiddle.net/5hhRF/" rel="nofollow">http://jsfiddle.net/5hhRF/</a></p>
  
  <p>there is number 1 2 1 2.... when u click last digit which is "2" it don't alert. </p>
  
  <p>Was I missing some code for that case?</p>
  
  <p>I am copying the same code here again.</p>
  
  <pre><code>&lt;span class="open-option" id="option1" &gt;1&lt;/span&gt;
  &lt;span class="open-option" id="option2" &gt;2&lt;/span&gt;
  
  &lt;span id="open-option" class="option1" &gt;1&lt;/span&gt;
  &lt;span id="open-option" class="option2" &gt;2&lt;/span&gt;​
  </code></pre>
  
  <pre>
  
      $(".open-option").click(function(){                    
         var myID=$(this).attr('id'); 
         alert(myID);
      });
  
      $("#open-option").click(function(){                    
         var myClass=$(this).attr('class'); 
         alert(myClass);
      });
  
  
                          ​</pre>