async function shortenUrl() { const url = document.getElementById("url-input").value; const btn = document.getElementById("submit-btn").value; // btn.enab const response = await fetch("/api/v1/urls", { method: 'PUT', headers: { "Content-Type": "application/json" }, body: JSON.stringify({ url: url, username: "anonymous" }) }); const data = await response.json(); const resultElement = document.getElementById("result"); if (response.ok) { resultElement.textContent = `Shortened Url: ${data.shortenedUrl}` resultElement.style.color = "black"; } else { resultElement.textContent = `Error: ${data.detail}` resultElement.style.color = "red"; } }