In summary I have a function that is as follows:
function datos3(){
resp=$("#ref_mi").val();
if(resp != "" && resp !=null &&typeof resp != undefined){
jqmSimpleMessage('Agrega cotizacion: '+resp);
$.ajax({
url: "rest/orden/item1/"+resp,
cache: false,
success: function(data) {
$.each(data, function (index, value) {
$("#matricula1").append('<a class="ui-btn ui-li-static ui-body-inherit ui-first-child ui-last-child" id="ref1" name="id_item" value="'+value.id_item+'" onclick="limpiar1()">'+value.id_marca+'-'+value.id_item+'-'+value.nomItem+'-'+value.nomMarca+'</a> <a id="lo1" value="'+value.id_marca+'" name="id_marca" style="display:none;">'+value.id_marca+'</a>');
});
},
error: function(error){
{
if(error.status==401){
desAuth();
}
jqmSimpleMessage("Error en listar infor empleado: "+error.responseText);
}
},
beforeSend: function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + getVCookie(getVCookie("userPro"))); }
});
}else{
jqmSimpleMessage('Error escoje un Producto');
}
}
This function does collect the data that I consult based on an id. Then I printed it on a div called a registration1 in the form of a button, my concern is that whenever I create a button on that div (Registration1) I want the ids of each button to be different and I do not know very well how to do it
For example, if that button has Id="refmi" that the next one that is created is Id="refmi1"