If conditional not working in jQuery each function
<p>Here is my html:</p>

<pre><code>&lt;div&gt;
  &lt;li&gt;
    &lt;a href="#"&gt;link&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;a href="#"&gt;link 2&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;a href="#"&gt;link 3&lt;/a&gt;
  &lt;/li&gt;
&lt;/div&gt;
</code></pre>

<p>This jQuery code is working fine:  </p>

<pre><code>$("div li").each(function() { 
    $('a', this).wrapInner("&lt;span&gt;&lt;/span&gt;");
});
</code></pre>

<p>However this breaks the code and nothing happens at all.</p>

<pre><code>$("div li").each(function() {   
    $('a', this).wrapInner("&lt;span&gt;&lt;/span&gt;");        
        if $('span', this).height() &gt; 10 {
            $(this).addClass('newClass');
        }

    });
</code></pre>

<p>What I need to happen is after the span is inserted into the link, I need the span's height to be measured and if its over 10px then for its containing li to have a class of newClass to be applied to it. </p>
