I want to have a button which when you click on it adds 1 to a number, which is displayed on the screen. This is how far I got.
<button onclick="addOne();">Click Me</button>
<input type="text" id="inc" value="0"></input>
<script>
function addOne()
{
i++;
document.getElementById('inc').value = i;
}
</script>
How can I make it so that the number is saved into a cookie so whenever I come back the number is not changed back into 0?