I don't want to include extra library for a small alert message. I want to dynamically append one to the DOM when need one and will fadeOut in 3s, and will remove from the DOM after.
I've tried codes below, but I have no luck and see nothing display.
$('body').append('<div id="msg" style="position: fixed; top: 0; left: 0; background:green; color:red; z-index: 999; "> copied ! </div>');
$("#msg").fadeIn('slow', function () {
$("#msg").delay(3000).fadeOut('slow');
});
$("#msg").remove();
Am I missing anything ?
