Linked Questions

Popular Questions

Public IP address as variable in JavaScript/HTML

Asked by At

How can I get a public IP address as a; var ip = $("#ip") ?

I hope to achieve is to put a public IP address into a var.

So far I have this:

<script type="text/javascript" src=""></script>
var yourip = document.getElementsByTagName("body")[0].ip
window.alert("your IP is" + yourip);
<span id="ip"></span>
<script type="text/javascript">
$.getJSON("", function (response) {

Related Questions