call function in the append

call function in the append

Hi

how to call a function in part created by Apprend?

$(document).ready(function() {

$('#add').click(addFormField);

$("#remove").click(remover);

function addFormField(){
var id = document.getElementById("id").value;
var numero = $('#numero').val();
var serie = $('#serie').val();

if ((numero.length > 0) && (serie.length > 0)){
$("#divTxt").append("<p id='row"+id+"'><label>"+id+"-<label>"+numero+"<input type='hidden' name='numero_"+id+"' value='"+id+"'/></label>-<label>"+serie+"<input type='hidden' name='serie_"+id+"' value='"+id+"'/></label>-<a href='#' id='remove' rel='row"+id+"'>Remover</a></p>");

id++;
document.getElementById("id").value = id;
}
}

function remover(){
var id = $(this).attr("rel");
$(id).remove();
return false;
}
});

thanks