0
Inside my 'data' div I load the JS information by id inside the spans, I am not able to load the image inside the span id='imgspan'
<div class="dados">
<label><span id="orderid"></span></label>
<label><span id="endereco"></span></label>
<label><span id="bairro"></span></label>
<label>imagem: <span id="imgspan" /></label>
</div>
$('#cities').change(function() {
var orderid = values[$(this).val()].OrderID;
var endereco = values[$(this).val()].Endereco;
var bairro = values[$(this).val()].Bairro;
var imgspan= values[$(this).val()].ImgSpan;
$('#orderid').text(orderid);
$('#endereco').text(endereco);
$('#bairro').text(bairro);
$('#imgspan').text(imgspan)
});
MY JS
var values = [
{"OrderID": "Santo André",
"Endereco": "Rua Bernardino de Campos, 171",
"Bairro":"Centro",
"ImgSpan":"<img src='../img/pointer.png' alt='' />"
}]
<span id="imgspan" />
... is wrong the syntax.– Diego Souza
Try <div id="Imgspan"></div>
– João Victor Gomes Moreira
By the way, I am your neighbor of São Bernardo haha, take also that "/ >" at the end of the <img src, that is not necessary.
– João Victor Gomes Moreira
Victor, it didn’t work replace the ID
– CRAJ