I am learning about HTML5 these days.
Here comes trouble when I want to remove just one of the data in the localStorage.
I know a method called clear()
to remove anything, but what can I do if I just remove one of the data by its key?
removeItem("data") With localStorage. removeItem('data') we can remove the localStorage item. Its use case is similar to setItem() – when we want to remove an item, we click a button to complete that functionality.
sessionStorage.removeItem('UserName');
localStorage.removeItem('UserName');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With