// Function to extract the "captcha" parameter from the iframe's URL function getUrlParameter(url, name) { const urlParams = new URLSearchParams(new URL(url).search); return urlParams.get(name); } // Function to check CAPTCHA from the iframe function checkCaptchaFromIframe() { const iframe = document.getElementById('captcha-frame'); const iframeUrl = iframe.src; // Get the URL of the iframe const captchaValue = getUrlParameter(iframeUrl, 'captcha'); // Check if the 'captcha' parameter exists and is a valid number if (captchaValue && !isNaN(captchaValue)) { document.getElementById('captcha-status').textContent = "CAPTCHA Passed!"; document.getElementById('captcha-status').style.color = "green"; } else { document.getElementById('captcha-status').textContent = "CAPTCHA Failed. No valid answer found."; document.getElementById('captcha-status').style.color = "red"; } }