if input field has a value found in array, do this (jQuery/Javascript)
<p>I've got a page with a handful of input fields.</p>

<p>I need to find the fields with an array of values, and if so, <code>.remove()</code> the <code>closest('tr')</code></p>

<p>The markup is similar to this</p>

<pre><code>&lt;table&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;input type="text" value="this"&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;input type="text" value="that"&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;input type="text" value="them"&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>I need to find "this" and "that", and if they are there, remove their <code>&lt;tr&gt;</code> container (and themselves) so I'd end up with:</p>

<pre><code>&lt;table&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;input type="text" value="them"&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>I've tried this:</p>

<pre><code>jQuery(document).ready(function($){
    var badfields = ['this', 'that'];
    var fieldvalue = $('input[type="text"]').val();

    if($.inArray(fieldvalue, badfields) &gt; -1){
        $(this).closest('tr').remove();   
    }
});
</code></pre>

<p>but it doesn't seem to want to work?</p>
