Last active
May 28, 2020 22:12
-
-
Save Rizwan-Hasan/93dfed2f1487a351378d6ed294a61cd7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Page Title</title> | |
</head> | |
<body> | |
<h1 align="center">Redirecting in <span id="countdown">10</span> seconds</h1> | |
<script type="text/javascript"> | |
// Total seconds to wait | |
var seconds = 10; | |
var webLink = "https://google.com"; | |
function countdown() { | |
seconds = seconds - 1; | |
if (seconds < 0) { | |
// Chnage your redirection link here | |
window.location = webLink; | |
} else { | |
// Update remaining seconds | |
document.getElementById("countdown").innerHTML = seconds; | |
// Count down using javascript | |
window.setTimeout("countdown()", 1000); | |
} | |
} | |
// Run countdown function | |
countdown(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment