I have some block where i appending some html (span) depends on specify function. If this function is done i appends this span to div. But i need to append something elese if this function is’t execute. So, my question is how to live check that in this div this span exist? This is my code:
if (...){
$('.info_check').append('<span></span>');
}
…
$('.info_check').on('DOMSubtreeModified',function(){
if($(this).html() == "") {
$('#instructions_panel').append('<span>...</span>');
}
});
i’v try with :empty and it’s alos not working…
try
if($(this).children('span').length==0)