Accurate compass mobile website
I want to make a compass in the browser (mobile website, NOT native applicaton). The purpose is that you have a button "Save current location to localstorage" and when you click on that button you save the latitude & longitude of the current location in the localstorage of the browser.
Then later when you are for example one kilometre from the location saved in the localstorage (for example on a parking) that you have a compass with an arrow headed to the location in your localstorage.
What I do now is save the location in the localstorage. But I don't now how I can make a compass headed to the location?
Can somebody help me? Give me some good search terms or know if this is even possible?
Thanks in advance!