`attr('id')` is failing inside my `each()` function
<p>jQuery</p>

<pre><code>var myID = new Array("A1","B2");
$.each($(".tab"), function(index,value) {

var id = value.attr('id'); //error here :(

if(id == myID[index])
id.addClass('sel');

}
</code></pre>

<p>HTML</p>

<pre><code>&lt;div class="tab" id="A1"&gt;&lt;/div&gt;
&lt;div class="tab" id="A2"&gt;&lt;/div&gt;
&lt;div class="tab" id="A3"&gt;&lt;/div&gt;

&lt;div class="tab" id="B1"&gt;&lt;/div&gt;
&lt;div class="tab" id="B2"&gt;&lt;/div&gt;
&lt;div class="tab" id="B3"&gt;&lt;/div&gt;
</code></pre>

<p>What I am trying to achieve here is, I want to add class to html which have matched with array <code>myID</code>. The code I have above throws an error on the line <code>var id = value.attr('id');</code>.</p>

<p>Can anyone help me fix this?</p>
