Get Country from IP

by Kishore Polsani

HTML

<span>192.110.160.11</span><br>
<span>177.67.82.22</span><br>
<span>36.75.102.33</span><br>

JavaScript

$("span").each(function(i){
    console.log(this);
    var self = this;
    var ip = $(this).text();
    $.get("http://ipinfo.io/"+ip, function (response) {
         $(self).html(ip+"-"+response.country);
    }, "jsonp");
});