I would like to ask if anybody sees what is going on. I have plenty experience with jQuery append elements while creating them, I made this several times but now Im struggling since 2 hours without being able to find my mistake, perhaps you can help me.
I'm trying to append the following as stated below:
var contactoHolder = $('<div />', {'class':"contactoUnexpanded",'id':indexed});
contactoHolder.append(infoArray[0]);
$('<div />', {'class':"editDelete", 'id':indexed+'editDelete'}).appendTo(contactoHolder);
$('<span />', {'class':"edit",'id':indexed+'_edit'}).appendTo('#'+indexed+'editDelete');
$('#'+indexed+'_edit').html('edit');
$('<span />', {'class':"delete",'id':indexed+'_delete'}).appendTo('#' + indexed + 'editDelete');
$('#' + indexed + 'delete').html('delete');
$('<span />', {'class':"contenidoDelContacto", 'id':indexed + 'Content'}).appendTo(contactoHolder);
$('#' + indexed + 'Content').html('<br />' + infoArray[1] + '<br />' + infoArray[2] + '<br />' + infoArray[3] + '<br />' + infoArray[4]);
$('#content').append(contactoHolder);
The only elementswhen I render that get definitively in the DOM are
<div id="19" class="contactoUnexpanded contactoExpanded">
Santiago
<div id="19editDelete" class="editDelete"></div>
<span id="19Content" class="contenidoDelContacto"></span>
</div>
I don't know why is not appending the rest of the elements as it should.
Thank you for your help.
infoArraycontain? Are you getting any console errors?