JSFiddle - React, Tailwind, and code Playground
by shrenuj
HTML
<!DOCTYPE html>
<html>
<body>
<p id="getCountry"></p>
<script>
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myObj = JSON.parse(this.responseText);
document.getElementById("demo").innerHTML = myObj.country_name;
}
};
xmlhttp.open("GET", "https://geolocation-db.com/json/0f761a30-fe14-11e9-b59f-e53803842572", true);
xmlhttp.send();
</script>
</body>
</html>