Please note this is just an example:
<img src="img/normal-font.png" onclick="javascript:document.body.style.fontSize = '13px';" />
<img src="img/medium-font.png" onclick="javascript:document.body.style.fontSize = '14px';" />
<img src="img/large-font.png"onclick="javascript:document.body.style.fontSize = '15px';" />
The body text does indeed enlarge if I choose one of them, but what I like to include is remembering what option you've chosen by reading cookies.
In fact, I have no experience in creating cookies in JS, only in PHP. Could someone come up with an example of how to make cookies the simpliest way remembering my option, but whenever someone clicks another one, it should get rid of the cookie that was last set, e.g. Cookie value has 15px, then should update it or remove it with a new cookie with a new value of 13px and so on.
Thanks :)
you can set and get the cookie values from javascript in the same way you do in php.
you can use the following two methods for your help.
have a look into this page for more details.