Answer the question
In order to leave comments, you need to log in
How to correctly remove a dynamically created DOM tree element?
The situation is as follows - a placeholder is placed in the bootstrap modal window, into which elements are inserted with the following code:
var mapWrapper = $(document.createElement('div'));
mapWrapper.attr('id', 'modalMapWrapper');
mapWrapper.appendTo('#modalMap');
var embed ="<iframe id='mapFrame' src='https://maps.google.com/maps?&q="+ encodeURIComponent(event.location) +"&output=embed'></iframe>";
$('#modalMapWrapper').html(embed);
$('#mapFrame').parent().remove();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question