I want to show a div for few seconds, so I coded:
var myVar;
function display() {
myVar = setTimeout(alertFunc, 1000);
}
function alertFunc() {
document.getElementById('random').innerText = rand;
}
but it not hiding after few seconds. how can I fix this?
and if I want this div to be in front of all the page (the other divs) for few seconds?