jQuery: append() object, remove() it with delay()
Using setTimeout() directly (which .delay() uses internally) is simpler here, since .remove() isn’t a queued function, overall it should look like this: $(‘body’).append(“<div class=”message success”>Upload successful!</div>”); setTimeout(function() { $(‘.message’).remove(); }, 2000); You can give it a try here. .delay() is for the animation (or whatever named) queue, to use it you’d have to do something … Read more