JavaScript URL Redirection

JavaScript URL redirect to another page after 5 seconds, fast redirect and delay timer redirect

HTML
You will be redirected in <input type="text" size="3" id="url_time"> seconds
JavaScript
(() => {
    const redirect_url = "https://www.html-code-generator.com/";
    const delay = 5; // second
    const input_time = document.getElementById("url_time");
    let time = input_time.value = delay;

    const redirectPage = () => {
        if (1 < time) {
            time -= 1;
            input_time.value = time;
            setTimeout(redirectPage, 1000);
        } else {
            window.location.href = redirect_url;
        }
    };
    redirectPage();
})();

Add Redirect URL

×
Redirect Start
Paste this code between the body tag where you want it to appear
JavaScript
Paste this code between the body tag, at the bottom of the page