Create a button and log the current LAT/LON when the button is pressed:
<button id="send-location"> Send location</button>
document.querySelector('#send-location').addEventListener('click', () => {
if (!navigator.geolocation) {
return alert ('Geolocation not supported by Browser !')
}
navigator.geolocation.getCurrentPosition((position) => {
console.log(position)
})
console.log output