top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How can we add and remove data from local storage?

+2 votes
363 views
How can we add and remove data from local storage?
posted May 14, 2015 by Manikandan J

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

If you want to remove/clean all the values from local storage than use

localStorage.clear();

And if you want to remove the specific item from local storage than use the following code

localStorage.removeItem(key);
answer May 14, 2015 by Vrije Mani Upadhyay
...