Jquery checked or display
<p>I have a problem with this code, I want do delete all <code>testdiv</code> with <code>style="display:none"</code> and all fields that aren't checked.</p>

<p>But with this code it deletes all <code>testdiv</code>.</p>

<pre><code>$("#post_form").submit(function() {
    if ($('div[id^="testdiv_"]').not(":checked") || $('div[id^="testdiv_"]').css("display", "none")) {
        $('div[id^="testdiv_"]').remove();
        alert('OK');
    }
    else {
        alert('Error');
    }
});
</code></pre>

<p>Thanks for the help.</p>
