JSFiddle - React, Tailwind, and code Playground
by pradeep
HTML
<h3>Client side IP geolocation using <a href="http://ipinfo.io">ipinfo.io</a></h3>
<hr/>
<div id="ip"></div>
<div class="lat-lang"></div>
<div id="address"></div>
<hr/>Full response: <pre id="details"></pre>
JavaScript
$.get("http://ipinfo.io", function (response) {
$("#ip").html("IP: " + response.ip);
$(".lat-lang").html("Lat Lang: " + response.loc);
$("#address").html("Location: " + response.city + ", " + response.region);
$("#details").html(JSON.stringify(response, null, 4));
}, "jsonp");