How to get contents of a DIV and play in php variable? [duplicate]

0

I have this JavaScript code that takes the location of the person and sends pro id="demo". How do I get the contents of the div with id="demo" and play in a php variable?

 var x = document.getElementById("demo");

function getLocation() {
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(showPosition);
    } else { 
        x.innerHTML = "";
    }
}

function showPosition(position) {
    x.innerHTML = "?pos=" + position.coords.latitude + ";" + position.coords.longitude;
}

window.onload = getLocation();
window.onload = showPosition();

Thank you in advance: D

    
asked by anonymous 11.08.2018 / 14:29

0 answers