Give your input the ID of "IP" as well as the name of "IP".
Then give your form a name if you want to target it in Javascript.
Giving a form a name will not show up as valid code in a strict debugger, but it is more efficient than having your JavaScript search for the input by ID.
Once you give your form a name, you will be able to use this code to fill the input:
document.FORMNAME.INPUTNAME.value = json.IP;
Otherwise you will have to use:
document.getElementById("IP").value = json.IP;