How to save, retrieve and remove data with JavaScript and HTML5

Thanks to localStorage. Saving, retrieving and removing temporary data is very easy. To save data, we call this function: localStorage.setItem(); To retrieve data, we call localStorage.getItem(); and to remove it we call localStorage.removeItem();.

Below is simple source code to show you how this three functions work:

You can see live result of these codes here:

Published by


Habibie is an Indonesian freelance frontend-backend web developer and cross platform mobile app programmer. He's also good at graphics design, video editing, visual effects and animation.