So I'm working on a save feature for my clicker game (for context the clicker game is about making limes) and it saves and loads my Limes And Clickers, but it doesn't display my current clickers and the current clicker cost, instead it is displaying 0 clickers and the original clicker cost (0). I haven't really tried anything different cause im not sure what i would try but here is my code (JavaScript and HTML).
function save() {
localStorage.setItem('ones', JSON.stringify(ones));
}
function load() {
ones = JSON.parse(localStorage.getItem('ones'));
}
________________________________________________________
<button onclick="save()">Save</button>
<button onclick="load()">Load</button>
<button onclick="buyClicker()">Buy Clicker</button>
<p>Clickers: <span id="Clickers">0</span></p>
<p>Clicker Cost: <span id="ClickerCost">10</span></p>
You are loading the saved data, but you are not updating the DOM. It would help if you considered manually changing the innerHTML of "Clickers" and "ClickerCost" by your script.