JQuery hiding elements bigger than variable in table
<pre><code>&lt;input type="checkbox" id="canafford"&gt;&lt;/input&gt;
</code></pre>

<p>I want it so when you check that checkbox, only upgrades that you can buy will appear. This is my upgrades code (it's a lot longer but I will show you only one part).</p>

<pre><code>&lt;tr id="up1"&gt;
  &lt;td&gt;&lt;button onclick="upgrade(2, 1)"&gt;Upgrade&lt;/button&gt;&lt;/td&gt;
  &lt;td&gt;2 gold&lt;/td&gt;
  &lt;td&gt;x2 Resting speed.&lt;/td&gt;
&lt;/tr&gt;
</code></pre>

<p>Each of them have id up1 up2 up3 etc. All I need is if gold (currency) is lower than its price it will hide.
Price is the second td in all of them; in this case its 2 gold.</p>