i have this code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test jQuery</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function() {
$(".add").click(function() {
$("#demos").append("<input type='text' size='20' name='txt[]'> <a href='#' onClick='removeFormField(); return false;'>Remove</a>");
return false;
});
});
function removeFormField() {
$(this).prev("input").remove();
}
</script>
<body>
<a class="add" href="#">add</a>
<div id="demos"></div>
</body>
</html>
and when i press add its work good but when click remove its not remove anything