diff --git a/app.js b/app.js index 13bddf8..3d582fc 100644 --- a/app.js +++ b/app.js @@ -82,7 +82,13 @@ function getMatchesv6(ipAddress) { async function handleLookup() { const input = document.getElementById("lookup"); - const text = input.value; + if (!input.value && input.placeholder) { + input.value = input.placeholder; + } + const text = input.value?.trim(); + if (!text) { + throw new Error('A value to lookup must be provided'); + } if (text && new URL(window.location).searchParams?.get("lookup") !== text) { const newUrl = new URL(window.location); newUrl.search = new URLSearchParams({ lookup: text }).toString() diff --git a/index.html b/index.html index 3373e00..7886055 100644 --- a/index.html +++ b/index.html @@ -31,7 +31,7 @@

Information about AWS IP addresses


- +