Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to clear localStorage when browser/tab is closing

window.addEventListener("beforeunload", () => localStorage.removeItem('storageVariable'));
 
PREVIOUS NEXT
Tagged: #How #clear #localStorage #closing
ADD COMMENT
Topic
Name
6+8 =