Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8702245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:36:19+00:00 2026-06-13T02:36:19+00:00

localStorage.getItem will retrive value. and setItem will set value. But If I want to

  • 0

localStorage.getItem will retrive value.

and setItem will set value.

But If I want to know which key was associated with this particular value? Then how to get Key of that.?

so question I have reffered

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:36:20+00:00Added an answer on June 13, 2026 at 2:36 am

    visit Html5 Storage Doc to get more details. Use the following syntax to set and get the values in localstorage/sessionstorage
    for storing values for a session

    sessionStorage.getItem('key')
    sessionStorage.setItem('key','value')
    

    or store values permanently using

    localStorage.getItem('key')
    localStorage.setItem('key','value')
    

    and u said u want to know the value but you want key then you can use the function

      localStorage.key(i);
    

    or also you can loop through the available keys and get the desired key by cross checking the value

    for(var i=0, len=localStorage.length; i<len; i++) {
        var key = localStorage.key(i);
        var value = localStorage[key];
        if(value.equals(desired_value))
        console.log(key + " => " + value);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I noticed that I cannot set boolean values in localStorage ? localStorage.setItem(item1, true); alert(localStorage.getItem(item1)
I am trying to redirect users of value of a localstorage key but it
In JS localStorage I can use localStorage.getItem(key); to get the value of the entry
I made a simple function localStorage.setItem('foo', 'bar') alert(localStorage.getItem('foo')); If I run it like this
I am using this code inside a jQuery plugin: setInterval(function() { localStorage.setItem(flag, set); var
I have a selectbox and I'm trying to set the value of localStorage.getItem(Selectoption) ,
Using this to load the json var jsonParsed = JSON.parse(localStorage.getItem('test')); Using this to save
Im using this code: $(this).css('backgroundcolor', localStorage.getItem('bgColorr') + !important;); When i write: alert( localStorage.getItem('bgColorr') +
HTML5's localStorage WebStorage has a maximum size of 5MB. Does this include the key
window.localStorage.setItem(Georgia,Atlanta) var x=window.localStorage.getItem(Georgia) I have a list of 50 states and the largest city

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.