I've been trying to get the value of the ip address, which is already inside <p id='details'></p>to be put in the value of the input html class as well found on the last line.
I tried declaring it as a php variable but I couldn't afford so.
<script>
var ipinfo;
$.getJSON("https://ipinfo.io", function (data) {
$("#details").html(data.ip)
})
</script>
<p id='details'></p>
<input type="text" name="ip" class="" value="@php echo ""; @endphp" readonly>