var x=document.getElementById(“demo”); function getLocation() { if (navigator.geolocation) { naviga…