Whenever i tried using document.write it replaces the current html page content in example i have this HTML
<body>
<div>
<h1>Hello</h1>
</div>
and this jQuery
var notif = document.write("<div class = 'bg' style = 'height:250px; width:400px; z-index:10; background:red;'>Good Morning!</div>");
$('body').append(notif).delay(5000).fadeOut()
this replace the whole page big Hello will be gone the jQuery will work after a 5 seconds it disappears then displays nothing?