title: Can not iterate over elements in Jquery
body: <p>I have function:</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $('#myTab a').click(function (e) {
              e.preventDefault();
              if ($(this).attr('href') === ('#' + $('#myTabContent').children('div').attr('id'))) {
                  alert($(this).attr('href'));
              }
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>and markup:</p>
  
  <pre><code> &lt;ul id="myTab" class="nav nav-tabs"&gt;
      &lt;li&gt;&lt;a href="#vergiSK" data-toggle="tab"&gt;
          &lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#spkSK" data-toggle="tab"&gt;
          &lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#hukukSK" data-toggle="tab"&gt;
         &lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;div id="myTabContent" class="tab-content"&gt;
      &lt;div class="tab-pane fade" id="vergiSK"&gt;
       &lt;ul&gt;
          &lt;li&gt;&lt;/li&gt;
          &lt;li&gt;&lt;/li&gt; 
       &lt;/ul&gt;
     &lt;/div&gt;
      &lt;div class="tab-pane fade" id="spkSK"&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;/li&gt;
          &lt;li&gt;&lt;/li&gt; 
       &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class="tab-pane fade" id="hukukSK"&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;/li&gt;
          &lt;li&gt;&lt;/li&gt; 
       &lt;/ul&gt;
      &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>The problem is that when I click on one of '<strong>a</strong>' elements I am getting only element with first ID. How can I get all matched '<strong>href</strong>' and values of '<strong>id</strong>'?</p>