I have this function, what I try to do is add an image to an option but there is no way.
To say that the value of the fields introduces me well in the option select but the photo does not appear. The page does not give any errors, I simply display the select and I see all the fields but not the image.
The reason for wanting to do this is that depending on whether a field is active or not, I want the select to have an icon telling the user that this person is active.
var ruta = "php/bombillaV.png";
$.ajax ({
url: "/loren/php/colab_x_usuario_token.php",
type: "POST",
success: function(data){
objJson=JSON.parse(data);
$.each(objJson, function(i, item) {
//if (objJson[i].estado_col == '1'){
$('#idColaboradorCT').append("<option style=background:url("+ruta+") no-repeat center left; padding-left:5px; value= "+objJson[i].id+" >"+" "+objJson[i].name + " " + objJson[i].apellidos+"</option>");
//}
});
}
});