Jquery defining id with a variable
<p>So this works fine, as you all know</p>

<pre><code>$("#foo").html = "bar";
</code></pre>

<p>But how would I do this?</p>

<pre><code>var i = "foo";
$(i).html= "bar";
</code></pre>

<p>I've tried <code>$("#"+i)</code> as well, but that doesn't work either.</p>
