normally, i am trying passing value in p,div and pre tag and values are show in above tag now i am passing country name in input tag. but value are not show in input tag. Here is my code:
<!DOCTYPE html>
<html>
<head>
<title>Get browser and ip address </title>
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<h1><a href="https://ipdata.co">ipdata.co</a> - IP geolocation API</h1>
<input type="text" name="country_name" id="country_name" value="">
<p id="country_name"></p>
<div id="ip"></div>
<div id="city"></div>
<pre id="response"></pre>
<script>
$.get("https://api.ipdata.co?api-key=test", function (response) {
$("#ip").html("IP: " + response.ip);
$("#city").html(response.country_name + ", " + response.region);
$("#country_name").html(response.country_name);
$("#response").html(JSON.stringify(response, null, 4));
}, "jsonp");
</script>
</body>
</html>
Thanks.