Using HTML Geolocation. The getCurrentPosition() method is used to return the user's position. The example below returns the latitude and longitude of the 6 days ago The Geolocation API allows the user to provide their location to web HTML. < button id = "find-me">Show my location