I have the following variable:
var id = doc.data().cd_id ;
In JavaScript, I dynamically add html:
"<button type='button' onclick='testeonclick(" + id + ")' class='btn btn-primary col-xs-12'>Editar Produto </button>"
My Role:
function testeonclick(id){
alert(id);
}
The following error occurred:
Uncaught SyntaxError: Invalid or unexpected token
My id has the following value: 4eCj7NkX9liruvf8izgF