How do i save game progress with cookies?
I would more recommend localStorage, so much easier to use, and you don't have to worry about expiration.
just like that! That's it! The value has to be a string, however.
and then to get a kei:
Number() just converts it into a number, which is useful for us.
document.cookie = "score=10";
But if you want to use more features out of
cookies, check out
It also gives you some code to create a wrapper function for setting and getting cookies.
You can also save info with