hello,
Website URL
www.jsapp.pl
i try to locate a user that click in button and i use a simple built in method to locate, but it don’t wanna working.
before I as sent files to the hosting i check website in liveserver and everything works well
here is a code to responsible to show latitude and longitude:\
const bat = document.querySelector('.location')
function fun() {
navigator.geolocation.getCurrentPosition(function (position) {
bat.innerHTML = position.coords.latitude + '<br>' + position.coords.longitude;;
})
}
bat.addEventListener('click', fun)
any suggestions?