'Clear specific LocalStorage in HTML/JavaScript

Is there any way to clear a specific localStorage in html using javascript:

localStorage.setItem("one");
localStorage.setItem("two");
//How to clear only "one"


Solution 1:[1]

You can remove an item from the localStorage with the removeItem function:

localStorage.removeItem(key);

So in your case:

localStorage.removeItem("one");

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sebastian Simon