function getCountryFromIP() {
fetch("https://freeipapi.com/api/json/")
.then((response) => response.json())
.then((data) => {
const country = data.countryName;
const countryElement = document.getElementById("Country");
if (countryElement) {
countryElement.value = country;
console.log(`Country: ${country} set based on IP location`);
} else {
console.warn("No element found with ID: Country");
}
});
}
window.onload = function () {
getCountryFromIP();
};