I am currently working on a website that has a dialog feature which I am trying to make functional by following these steps:
The dialog is created using .append() method, then it is set to wait for 5 seconds before fading out and being removed. Despite my efforts, the code I have written does not seem to be working as intended.
HTML
<div class="addAddressDialog"></div>
<div class="overlay"></div>
JavaScript
$(".addAddressDialog").append("<span> Thank you </span>")
.delay(5000)
.queue(function(next){
$('.addAddressDialog, .overlay').fadeOut('fast',function(){$(this).remove()});
});