diff --git a/index.html b/index.html index 76627b9..df88528 100644 --- a/index.html +++ b/index.html @@ -50,20 +50,20 @@

Subdomain Checker

btn.setAttribute("disabled", true); btn.innerHTML = "Checking Domain..."; - fetch(`https://api.freesubdomains.org/check?domain=${subdomain.value}.${domain.value}`).then(res => res.json()).then(data => { + fetch(`https://api.freesubdomains.org/check?domain=${subdomain.value.trim().toLowerCase()}.${domain.value}`).then(res => res.json()).then(data => { btn.removeAttribute("disabled"); btn.innerHTML = "Check Domain"; if(data.message === "DOMAIN_AVAILABLE") { status.classList = "text-green-600 font-semibold"; - status.innerHTML = `Congratulations, ${subdomain.value}.${domain.value} is available! Register now!`; + status.innerHTML = `Congratulations, ${subdomain.value.trim().toLowerCase()}.${domain.value} is available! Register now!`; } else { status.classList = "text-red-600 font-semibold"; - status.innerHTML = `Sorry, ${subdomain.value}.${domain.value} is unavailable!`; + status.innerHTML = `Sorry, ${subdomain.value.trim().toLowerCase()}.${domain.value} is unavailable!`; } form.reset(); }) } - \ No newline at end of file +