I’m not exactly sure what’s going on, but I’m having problems with navigator.geolocation.getCurrentPosition for my weather application project. Any changes that are made in my success object are not altering variables, or permanently changing html. For example, the program is able to change the text of an element with the latitude, longitude but if I try to get the text of the element afterwards (even though the page has updated with the latitude/longitude), it returns an empty string. Additionally if I do something like change the value of a variable in the function, outside of the function nothing happens. What am I missing / how can I store the value of latitude / longitude for later use?
Here’s the codepen to what I’m trying to get working: https://codepen.io/Daniel_Lawson9999/pen/JOWeWW