When remove the Class. nochange on class'length?
<pre><code>&lt;% (1..3).each do %&gt;
    &lt;p id="input"&gt;
        &lt;input type="text" name="somename"/&gt;
        &lt;a class="remove" &gt;Remove&lt;/a&gt;
    &lt;/p&gt;
&lt;% end %&gt;
</code></pre>

<p>jQuery:</p>

<pre><code>var $remove=$(".remove")

$remove.click(
function(){
    $(this).parent().remove();
            alert($remove.length);
})
</code></pre>

<p>It always alerts <code>3</code>, why? Did I remove the class <code>remove</code> correctly?</p>
