I am creating tags
of products through an Ajax search, similar to stackoverflow
$('#_keytags').tokenfield({
autocomplete: {
source: function(request,response){
$.ajax({
url: routes(4,2),
type: "post",
dataType: "json",
data:{keys: request.term},
success: function(data){
response(data);
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
console.log(errorThrown);
}
});
},
minLength: 1,
select: function(event,ui){
},
delay: 100
},
showAutocompleteOnFocus: true
});
My question is how can I add a
id
to thesetags
and how go through these elements getting yourid
?