<?php




$dochtml = new DOMDocument();
$dochtml->loadHTMLFile("index.php.html");


$div = $dochtml->getElementById('div2')->nodeValue;


?>




<!DOCTYPE html>
<html>
<body>
<div>
<h1>HTML Geolocation</h1>
<p>Click the button to get your coordinates.</p>

<button onclick="getLocation()">Try It</button>

<p id="demo"></p>

<script>
const x = document.getElementById("demo");

function getLocation() {
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(showPosition);
  } else { 
    x.innerHTML = "Geolocation is not supported by this browser.";
  }
}

function showPosition(position) {
  x.innerHTML = "Latitude: " + position.coords.latitude + 
  "<br>Longitude: " + position.coords.longitude;
}
</script>
</div>
</body>
</html>


