Group multiple or statements within an IF in javascript
<p>The following code works:</p>

<pre><code>$(".valClear").each(function () {
        if ($(this).val().indexOf(".png") == -1) {
            $(this).val('');
        }
    });
</code></pre>

<p>However this doesn't (the value is removed even if it contains .png or .jpeg), what am I doing wrong?</p>

<pre><code>$(".valClear").each(function () {
        if (($(this).val().indexOf(".png") == -1) || ($(this).val().indexOf(".jpeg") == -1)) {
            $(this).val('');
        }
    });
</code></pre>
