Assigning and using jquery with variables
<p>I have two peices of code. One produces the desired result the other one doesnt.</p>

<p>Works: </p>

<pre><code>$("#inBox" + mesh.id).html(mesh.text);
</code></pre>

<p>Doesn't work:</p>

<pre><code>var inbox = $("#inBox" + mesh.id);
inbox.html(mesh.text);
</code></pre>

<p>Could someone please explain to me why one produces the desired result and the other one doesn't do anything?</p>

<p>edit: removed typo quote mark.</p>

<p>edit2: heres the fiddle. <a href="http://jsfiddle.net/ntkachov/zXGjb/" rel="nofollow">http://jsfiddle.net/ntkachov/zXGjb/</a></p>

<p>edit3: Hmmm.... It works inside the fiddle but not inside my code. Ill take a look at what else might be affecting this.</p>
