how to use localStorage in javascript
Microsoft Net Framework
  • .Net
  • 352
  • May-22-2018
  • by 

how to use localStorage in javascript?

below code will be in  <javascript> code here </script>

set value  

localStorage.setItem("key", "value");

 

Get value

var lastname = localStorage.getItem("key");

if (lastname)

{

// do some things if have value

}

else

{

// do some things

}

Remove value

localStorage.removeItem("key");

 

 

Share This with your friend by choosing any social account


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM