jQuery looping through an object array
<p>I have the following HTML and JS, I am trying to only display elements if they match the criteria selected in the <code>&lt;select&gt;</code> tags. I am fairly sure that my IF statement currently would not achieve what I am trying to do even if it did work, however I am struggling to think of the logic for this.</p>

<p>HTML:</p>

<pre><code>&lt;select id="price-from" class="form-control"&gt;        
    &lt;option selected value="£500"&gt;£500&lt;/option&gt;
    &lt;option value="1000"&gt;£1,000&lt;/option&gt;
    &lt;option value="2000"&gt;£2,000&lt;/option&gt;
    &lt;option value="3000"&gt;£3,000&lt;/option&gt;
    &lt;option value="4000"&gt;£4,000&lt;/option&gt;
    &lt;option value="5000"&gt;£5,000&lt;/option&gt;
    &lt;option value="10000"&gt;£10,000&lt;/option&gt;
    &lt;option value="20000"&gt;£20,000&lt;/option&gt;
&lt;/select&gt;

&lt;p&gt;To&lt;/p&gt;

&lt;select id="price-to" class="form-control"&gt;
    &lt;option value="500"&gt;£500&lt;/option&gt;
    &lt;option value="1000"&gt;£1,000&lt;/option&gt;
    &lt;option value="2000"&gt;£2,000&lt;/option&gt;
    &lt;option value="3000"&gt;£3,000&lt;/option&gt;
    &lt;option value="4000"&gt;£4,000&lt;/option&gt;
    &lt;option value="5000"&gt;£5,000&lt;/option&gt;
    &lt;option value="10000"&gt;£10,000&lt;/option&gt;
    &lt;option selected value="20000"&gt;£20,000&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>JavaScript:</p>

<pre><code>$(document).ready(function(){
    var product1 = {title:"Cute Gnome", type:"Cute", price:"3999"};
    var product2 = {title:"Funny Gnome", type:"Funny", price:"5999"};
    var product3 = {title:"Seasonal Gnome", type:"Seasonal", price:"12999"};
    var product4 = {title:"Horror Gnome", type:"Horror", price:"7999"};
    var productArray = [
        product1, product2, product3, product4
    ];      
    var len = productArray.length;
    for (var i = 0; i &lt; len; i++) {
        if ($("#price-from").val() &lt; productArray[i].price &amp;&amp; $("#price-to").val() &gt; productArray[i].price){
            //Loop through code and only output objects between both price criteria
        }
    }
});
</code></pre>