jquery append and remove element problem
<p>i have this code</p>

<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;title&gt;Test jQuery&lt;/title&gt;

&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;

&lt;script type="text/javascript"&gt;
$(function() {
$(".add").click(function() {
    $("#demos").append("&lt;input type='text' size='20' name='txt[]'&gt;  &lt;a href='#' onClick='removeFormField(); return false;'&gt;Remove&lt;/a&gt;");

return false;
    });
});

    function removeFormField() {
    $(this).prev("input").remove();
    }


&lt;/script&gt;

&lt;body&gt;
&lt;a class="add" href="#"&gt;add&lt;/a&gt;
&lt;div id="demos"&gt;&lt;/div&gt;


&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>and when i press add its work good but when click remove its not remove anything</p>
