From c020aacdce0ba23cea75056c165bf3cdfcaacbf1 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Fri, 4 Aug 2023 15:46:53 +0200 Subject: [PATCH] Add simple button to try again for now --- script.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/script.js b/script.js index 2073a9c..a693ca3 100644 --- a/script.js +++ b/script.js @@ -48,13 +48,23 @@ function createCheckButton(destination) { check(destination, container, dot, message, button); } +function createTryAgainButton(destination) { + const button = document.createElement('button'); + button.textContent = 'Try Again'; + button.onclick = function () { + window.location.href = destination; + } + + document.getElementById('checkContainer').appendChild(button); +} + function checkDestination() { const url = window.location.search; const searchParams = new URLSearchParams(url); const destination = searchParams.get('destination'); if (destination) { - createCheckButton(destination); + createTryAgainButton(destination); } }