document.addEventListener("DOMContentLoaded", () => { let countdown = 5 let el = document.querySelector("#countdown") const loop = () => { if (countdown == 0) { document.location = "https://www.pearson.de/abiturpruefung-bayern-2022-deutsch-9783849052010" } el.innerHTML = countdown-- } loop() setInterval(loop, 1000) })