I have a bootstrap 3 columns youtube videos
<div class="col-md-4">
<div class="video_img_wrapper">
<img class="video_img" data-toggle="modal" class="ytVideo" id="'.$item->id->videoId.'" data-target="#myModal_'.$item->id->videoId.'" src="'.$thumbnailUrl.'" />
<img src="'.get_bloginfo('template_url').'/assets/img/playicon-nl.png" class="fa-play-circle-o" aria-hidden="true" data-toggle="modal" data-target="#myModal_'.$item->id->videoId.'" />
</div>
<div class="video_title"><span>'. $item->snippet->title .'</span></div>
</div>
<div class="modal fade youtube-modal" id="myModal_'.$item->id->videoId.'" role="dialog">
<div class="modal-dialog">
<div class="modal-body" id="videoModalBody"></div>
</div>
</div>
And I am injecting an iframe using jquery in the #videoModalBody div
$(".video_img").click(function(evt){
var videoId = $(this).attr("id");
var iframe = '<iframe enablejsapi=1 id="myModal_'+videoId+'" width="850" height="500" src="https://www.youtube.com/embed/'+videoId+'" frameborder="0" allowfullscreen></iframe>';
$("#videoModalBody").append(iframe);
});
How can I change my Javascript so when I click on another video the previous one gets removed out of the DOM?