1
First of all, my code:
function renderLiberarCarro(liberar, userId, docId){
var documentId = docId;
var aviso = '<span class="badge badge-pill badge-sussess">Liberar</span>';
var photo = '<%= dataUser.photo %>';
if(photo == null){
photo = "public/assets/images/users/avatar-2.jpg";
}
$("table.liberar tbody").append(
'<tr class='+documentId+'>'+
'<td class='+liberar.marca+'> Cliente Medcar: '+ liberar.cliente +'</td>'+
'<td class='+liberar.marca+'>'+ liberar.marca +'</td>'+
'<td class='+liberar.marca+'>'+ liberar.modelo +'</td>'+
'<td class='+liberar.marca+'>'+ liberar.ano +'</td>'+
'<td class='+liberar.marca+'>'+ aviso +'</td>'+
'<td class='+liberar.marca+'><a onclick=\"liberarCarro('+documentId+')\" id="'+ docId +'" href="#" data="'+docId+'" class="btn btn-secondary action-liberar btn-sm waves-effect">Liberar</a> '+
'</tr>'
);
};
function liberarCarro(docId){
console.log(docId)
}
at last td insert an onclick into it and call the car release function and step a value, but instead of seeing the value the return is being this:
<a onclick="liberarCarro(eVzsQHCk4UozJ4MQI26S)" id="eVzsQHCk4UozJ4MQI26S" href="#" data="eVzsQHCk4UozJ4MQI26S" class="btn btn-secondary action-liberar btn-sm waves-effect">Liberar</a>
is returning the full tag, what I expected back was just: eVzsQHCk4UozJ4MQI26S. Can anyone tell me why?
Thank you
SOLVED: '<td class='+release.brand+'><a onclick="release Box("'+documentId+'")" id="'+ docId +'" href="#" data="'+docId+'" class="btn btn-Secondary action-release btn-Sm Waves-Effect">Release</a> '+
– Robson Dona