I am trying to make a value, called Iron, increase every second whilst in localStorage, but the value just adds a 1 on the end instead of increasing by 1.
HTML:
<div id="iron"></div>
Javascript:
var material1= "0";
localStorage.setItem("Iron","1");
window.setInterval(
function () {
material1 = material1 + 1;
localStorage.setItem("Iron",material1);
document.getElementById("iron").innerHTML = 'Current Iron Supply is: ' + localStorage.getItem("Iron");
}, 1000);
</script>