Javascript -- filter set of links and style
<p>Here is my set of links:</p>

<pre><code>&lt;ul id="power"&gt;
    &lt;li&gt;&lt;a id="10watt" name="power" href="#"&gt;10 watt&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a id="25watt" name="power" href="#"&gt;25 watt&lt;/a&gt;
    &lt;li&gt;&lt;a id="30watt" name="power" href="#"&gt;30 watt&lt;/a&gt;
    &lt;li&gt;&lt;a id="40watt" name="power" href="#"&gt;40 watt&lt;/a&gt;
    &lt;li&gt;&lt;a id="50watt" name="power" href="#"&gt;50 watt&lt;/a&gt;
    &lt;li&gt;&lt;a id="60watt" name="power" href="#"&gt;60 watt&lt;/a&gt;
    &lt;li&gt;&lt;a id="75watt" name="power" href="#"&gt;75 watt&lt;/a&gt;
    &lt;li&gt;&lt;a id="100watt" name="power" href="#"&gt;100 watt&lt;/a&gt;
    &lt;li&gt;&lt;a id="120watt" name="power" href="#"&gt;120 watt&lt;/a&gt;
    &lt;li&gt;&lt;a id="150watt" name="power" href="#"&gt;150 watt&lt;/a&gt;
&lt;/ul&gt;
</code></pre>

<p>and then I have an array:</p>

<pre><code>var nine = ['25watt','30watt','40watt','50watt','60watt','75watt'];
</code></pre>

<p>I want to filter the links so the ones not in the array are styled with the "unavailable" class defined in my CSS.  Here is my jQuery.</p>

<pre><code>if (this.id == '93') {
           $('a [name="power"]').filter(function() {
               if ($.inArray($(this).attr('id'), nine) &lt; 0)
               $(this).addClass('unavailable');
               $(this).removeAttr('href');
           });
      }
</code></pre>

<p>this.id comes from the previous set of links,  How do I write my filter statement, because what I have isn't working.  Thanks for your help.</p>
