Learning Local Storage in JavaScript..
Hello everyone
In the previous posts, we have discussed the basics of javascript. In this post, we are going to discuss another important topic of JavaScript which is Local Storage. Local Storage is one of the most important topic of JavaScript. What it actually does is store our data in the host. Every website has its own local storage.
For Example let me show you the local storage of google website.
I have the google .com open and when write the localStorage in the console. it actually prints the data from the google localStorage.
As you can see some of the numbers and text but this is not our topic. It was to help you understand where and how can we access the localStorage.
Let's just dive into our tutorial.
Here I have a simple HTML file.
If I try to print its local storage it will be empty because i just cleared the local Storage before writing this post.
Now we will store something in the Local Storage with the help of setItem() method.
Now if I save it and then console log the local storage it will print something like this.
we can use another method to get just a single item which is getItem(). If I need to get the property of name only then we can just pass it through the parameter of getItem. just like that.
we can use the ket method to access the properties index wise.
by using the remove method we can remove a single item
and with a clear method, we can clear everything.
I think this much is enough for today. Now if you like the post please upvote and comment if you want to give me some advise
Leave Learning Local Storage in JavaScript.. to:
Read more #hive-148441 posts
Best Posts From ProGrammer
We have not curated any of pakgamer's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From ProGrammer
- What do you think your Password is Secure?
- Nodejs Tutorial-- Sending Email using NodeMailer
- Node.js Tutorial --Reading and Writing files
- How to install Nodemon-- Express.js Tutorials
- How to use Range Element in a simple voting tool
- Learning Express.js-- installation and Hello World Example
- How to Compile your C/C++ code on the Visual Studio Code.
- How to check Voting Power And Resource Credit of Hive Account Through dhive
- How To Send Message TO WhatsApp Using JavaScript/Node.js-- Twilio
- How to add Custom prefix to your Discord Bot. Discordjs Tutorial
- HiveJs Tutorials --Learning how to transfer HIVE/HBD thorugh HiveJs
- Fetching API -- JavaScript Tutorial
- Learning Local Storage in JavaScript..
- Hivejs Tutorials-- #3
- Learn jQuery. Learning Events/Methods
- Learn jQuery --- Learning Selectors
- Learning JQuery-- Understanding the basics
- TypeScript for beginners -- A quick start
- How to Stream Hive Blockchain Transactions.-- HIVED
- Grand Theft Auto V (GTA 5) is now free on Epic Games Store.