Hide a div based on value of a submit button
<p>I'm looking to hide a submit button with a value of 'foo', <strong>but only if</strong> the div it resides within has a class of 'foo2'. </p>

<p>The following jQuery does half the job, hiding the submit button if it contains 'foo' in its value, however it works across the board, if its within foo2 or not. </p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function () {
   $("input[value=foo]").closest('div').hide();
});
&lt;/script&gt;
</code></pre>

<p>Any ideas?</p>
