Transform jquery variable in text

Transform jquery variable in text

Hello, 
I have this very short code to obtain latitude/longitude  :

  1. <div id="infoposition"></div><br>
  2. <script>
  3. function maPosition(position) {
  4.   var infopos = "<br>";
  5.   infopos += "Latitude : "+position.coords.latitude +"<br>";
  6.   infopos += "Longitude: "+position.coords.longitude;
  7.   document.getElementById("infoposition").innerHTML = infopos;
  8. }
  9. if(navigator.geolocation)
  10.   navigator.geolocation.getCurrentPosition(maPosition);
  11.  </script>
When I open my file I obtain this :


  1. Latitude : X.1202949
  2. 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 ?