Mrunay Uttarwar
Mrunay Uttarwar

@MrunayU

10 Tweets 1 reads Nov 05, 2022
πŸ”· About HTML Web Storage API - 2
A Thread🧡 πŸ‘‡
πŸ“Œ The localStorage Object
β†’ The localStorage object stores the data with no expiration date.
β†’ The data will not be deleted when the browser is closed, and will be available the next day, week, or year.
β†’ Example explained:-
β€’ Create a localStorage name/value pair with name="lastname" and value="Smith" .
β€’ Retrieve the value of "lastname" and insert it into the element with id="result".
β†’ The example given in the above tweet could also be written like this,
β†’ The syntax for removing the "lastname" localStorage item is as follows.
β›” Note: - Name/value pairs are always stored as strings. Remember to convert them to another format when needed!
πŸ“Œ The sessionStorage Object
β†’ The sessionStorage object is equal to the localStorage object, except that it stores the data for only one session.
β†’ The data is deleted when the user closes the specific browser tab.
β†’ The following example counts the number of times a user has clicked a button, in the current session.
Thanks for reading this thread ❀️
If you like it , make sure you:
πŸ”· Like the tweet
πŸ”· Retweet the first tweet ⚑
For more content , follow:
@MrunayU
You can read the unrolled version of this thread here: typefully.com

Loading suggestions...