I am building a interstitial page, using
Everything is working, but I also would like to close the div\'s aft
I believe you are looking for the setTimeout function.
To make your code a little neater, define a separate function for onclick in a block:
function myClick() {
setTimeout(
function() {
document.getElementById('div1').style.display='none';
document.getElementById('div2').style.display='none';
}, 5000);
}
then call your function from onclick
onclick="myClick();"