Storage in HTML was done with the help of cookies. The exciting thing about this storage is that it's fast as well as secure.
Two types of storage are in HTML5
Methods
Using local storage in modern browsers is ridiculously easy. All you have to do is modify the localStorage object in JavaScript. You can do that directly use the setItem() and getItem() method: localStorage.setItem('favoriteflavor','vanilla'); If you read out the favoriteflavor key, you will get back "vanilla": var taste = localStorage.getItem('favoriteflavor'); // -> "vanilla" To remove the item, you can use- the removeItem() method:
localStorage.removeItem('favoriteflavor'); var taste = localStorage.getItem('favoriteflavor'); // -> null That's it! You can also use sessionStorage instead of localStorage if you want the data to be maintained only until the browser window closes.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: