using $.each to addClass to elements
<p>I'm trying to style a sub-set of anchors using an array</p>

<p>HTML &amp; CSS:</p>

<pre><code>&lt;div&gt;
    &lt;a href="#1"&gt;one&lt;/a&gt;
    &lt;a href="#2"&gt;two&lt;/a&gt;
    &lt;a href="#3"&gt;three&lt;/a&gt;
    &lt;a href="#4"&gt;four&lt;/a&gt;
    &lt;a href="#5"&gt;five&lt;/a&gt;
    &lt;a href="#6"&gt;six&lt;/a&gt;
    &lt;a href="#7"&gt;seven&lt;/a&gt;   
&lt;/div&gt;

.hilight {
    background: #f00;
}
</code></pre>

<p>e.g. how would I add the class 'hilight' to anchors 2, 5, &amp; 6...</p>

<p>Having tested this:</p>

<pre><code>$("a[href='#5']").addClass('hilite');
</code></pre>

<p>I tried the the following with $.each(), which doesn't work. I guess I'm iterating over each anchor 3 times, but I didn't expect NO output! </p>

<pre><code>var arr = ["#2", "#5", "#6"];   
$.each(arr, function(index, value) {
    $("a[href=value]").addClass('hilite');'
});
</code></pre>

<p>Can someone point me in the right direction please :)</p>
