Transform jquery variable in text
Hello,
I have this very short code to obtain latitude/longitude :
- <div id="infoposition"></div><br>
- <script>
- function maPosition(position) {
- var infopos = "<br>";
- infopos += "Latitude : "+position.coords.latitude +"<br>";
- infopos += "Longitude: "+position.coords.longitude;
- document.getElementById("infoposition").innerHTML = infopos;
- }
- if(navigator.geolocation)
- navigator.geolocation.getCurrentPosition(maPosition);
- </script>
When I open my file I obtain this :
- Latitude : X.1202949
- Longitude: Y.1686232
But I want to have the value in "text" on the webpage code source, but I don't know how to convert the result in "echo" or "html" or something like that. Any idea ?