JSFiddle - React, Tailwind, and code Playground
HTML
<h3>Client side IP geolocation using <a href="http://ipinfo.io">ipinfo.io</a></h3>
<hr/>
<div id="ip"></div>
<div id="address"></div>
<hr/>Full response: <pre id="details"></pre>
JavaScript
$.get("http://ipinfo.io", function (response) {
console.log(response.country);
}, "jsonp");