Get HTML5 localStorage keys

I’m just wondering how to get all key values in localStorage.


I have tried to retrieve the values with a simple JavaScript loop

for (var i=1; i <= localStorage.length; i++)  {
   alert(localStorage.getItem(i))
}

But it works only if the keys are progressive numbers, starting at 1.


How do I get all the keys, in order to display all available data?

85 thoughts on “Get HTML5 localStorage keys”

  1. I’m extremely pleased to discover this great site. I wanted to thank you
    for ones time for this fantastic read!! I definitely appreciated every bit
    of it and i also have you bookmarked to look at new stuff
    on your blog.

    Reply
  2. You really make it seem so easy with your presentation but I find this matter to be actually something that I think I would never understand.
    It seems too complicated and very broad for me.
    I’m looking forward for your next post, I’ll try to get
    the hang of it!

    Reply
  3. At this time it sounds like WordPress is the top blogging platform out there right now.
    (from what I’ve read) Is that what you’re using on your blog?

    Reply
  4. I just like the helpful information you supply on your
    articles. I’ll bookmark your weblog and test once more right here frequently.

    I’m relatively sure I’ll be told many new stuff proper here!

    Best of luck for the following!

    Reply
  5. After looking at a number of the articles on your web page, I
    seriously appreciate your way of blogging. I added it to my bookmark webpage list and will be checking back in the near future.
    Take a look at my website too and let me know how
    you feel.

    Reply
  6. I like the helpful information you supply to your articles.
    I will bookmark your blog and check once more here
    frequently. I’m rather certain I’ll be informed lots of new stuff proper right here!
    Good luck for the next!

    Reply
  7. Hmm it appears like your site ate my first comment (it was extremely long) so
    I guess I’ll just sum it up what I had written and say, I’m
    thoroughly enjoying your blog. I as well am an aspiring
    blog writer but I’m still new to the whole thing.
    Do you have any tips and hints for first-time blog writers?

    I’d really appreciate it.

    Reply
  8. Hi this is somewhat of off topic but I was wanting
    to know if blogs use WYSIWYG editors or if you have
    to manually code with HTML. I’m starting a blog soon but have no coding know-how so I wanted to get
    guidance from someone with experience. Any help would be enormously appreciated!

    Reply
  9. hi!,I love your writing so so much! percentage we be in contact extra about your article on AOL?
    I require an expert on this area to resolve my problem. Maybe that’s
    you! Looking ahead to see you.

    Reply
  10. Hi there everybody, here every one is sharing these kinds of knowledge, therefore
    it’s fastidious to read this weblog, and I used to pay a
    quick visit this webpage everyday.

    Reply
  11. What’s Happening i’m new to this, I stumbled upon this I’ve discovered It positively useful and it has
    helped me out loads. I’m hoping to contribute & help different
    users like its aided me. Great job.

    Reply
  12. I don’t even know the way I ended up right here, but I assumed this publish was good.
    I don’t realize who you are however certainly you are going
    to a well-known blogger in case you aren’t already.
    Cheers!

    Reply
  13. You have made some good points there. I checked on the net to find out more about
    the issue and found most people will go along with
    your views on this site.

    Reply
  14. Hey there! Would you mind if I share your blog with my facebook group?
    There’s a lot of folks that I think would really enjoy your content.
    Please let me know. Cheers

    Reply
  15. At this time it looks like Expression Engine is the top blogging platform available right now.

    (from what I’ve read) Is that what you’re using on your blog?

    Reply
  16. Pretty part of content. I just stumbled upon your blog and in accession capital to assert that I acquire actually loved
    account your weblog posts. Anyway I’ll be subscribing for your augment or even I fulfillment you get right of
    entry to constantly quickly.

    Reply
  17. Heya i am for the first time here. I found this board
    and I find It really useful & it helped me
    out much. I hope to give something back and help others like you aided
    me.

    Reply
  18. Simply desire to say your article is as astounding.
    The clearness in your post is simply nice and i could
    assume you are an expert on this subject. Fine with your
    permission let me to grab your RSS feed to keep updated with forthcoming
    post. Thanks a million and please carry on the enjoyable work.

    Reply
  19. Heya i’m for the first time here. I found this board and I find It truly
    useful & it helped me out a lot. I hope to give something back and help others like you aided
    me.

    Reply
  20. Oh my goodness! Impressive article dude! Many thanks, However I am having
    issues with your RSS. I don’t know the reason why I cannot join it.
    Is there anyone else having the same RSS issues?
    Anybody who knows the solution will you kindly respond? Thanx!!

    Reply
  21. I would like to thank you for the efforts you
    have put in penning this site. I really hope to view the same high-grade content
    from you in the future as well. In fact, your creative writing
    abilities has encouraged me to get my very own blog now 😉

    Reply
  22. I am really enjoying the theme/design of your weblog.

    Do you ever run into any browser compatibility issues?
    A couple of my blog audience have complained about my website not operating correctly
    in Explorer but looks great in Chrome. Do you have
    any tips to help fix this problem?

    Reply
  23. Very nice post. I just stumbled upon your weblog and wished to say that
    I’ve truly enjoyed surfing around your blog posts.
    After all I’ll be subscribing to your rss feed and I hope you write again soon!

    Reply
  24. You could certainly see your skills in the article you write.

    The sector hopes for even more passionate writers like you who aren’t afraid
    to say how they believe. At all times follow your heart.

    Reply
  25. Hi exceptional website! Does running a blog similar to this take a large amount of work?
    I’ve very little knowledge of computer programming however I
    had been hoping to start my own blog in the near future.
    Anyhow, should you have any ideas or tips for new blog owners please
    share. I know this is off topic however I just had to ask.
    Appreciate it!

    Reply
  26. Hi I am so thrilled I found your site, I really found you by error, while I was looking on Google for something else, Anyhow I am here now and would just like to say kudos for a remarkable
    post and a all round enjoyable blog (I also love the theme/design), I don’t
    have time to read through it all at the minute but I have bookmarked it and also added your RSS
    feeds, so when I have time I will be back to read much more, Please do keep up
    the superb job.

    Reply
  27. I have been browsing on-line more than three hours these days, but I by no means found any attention-grabbing article like yours.
    It’s pretty value sufficient for me. In my view, if all webmasters and bloggers made just right content material as you
    did, the web can be a lot more useful than ever before.

    Reply
  28. Wow, awesome blog layout! How long have you been blogging for?
    you make blogging glance easy. The overall look of your web site
    is great, let alone the content material!

    Reply
  29. Right here is the perfect web site for anyone who wants to understand this
    topic. You realize a whole lot its almost hard to argue with
    you (not that I actually would want to…HaHa). You certainly put a brand new spin on a subject that’s been discussed for decades.
    Excellent stuff, just great!

    Reply
  30. Do you have a spam problem on this website; I
    also am a blogger, and I was wanting to know your situation; we have developed some nice practices and we are looking to trade solutions with
    other folks, be sure to shoot me an e-mail if interested.

    Reply
  31. Hey There. I found your weblog the usage of msn. This is a really well written article.
    I will make sure to bookmark it and come back to read more of your useful information. Thank you
    for the post. I’ll certainly comeback.

    Reply
  32. Does your site have a contact page? I’m having trouble locating it but, I’d like to shoot you an email.

    I’ve got some creative ideas for your blog you might be interested in hearing.

    Either way, great website and I look forward to seeing it grow over time.

    Reply
  33. Magnificent beat ! I wish to apprentice while you amend your site, how can i subscribe for a blog web site?
    The account aided me a acceptable deal. I had been tiny bit
    acquainted of this your broadcast offered bright
    clear concept

    Reply
  34. Amazing! This blog looks exactly like my old one! It’s on a entirely different
    subject but it has pretty much the same layout and design. Great choice of colors!

    Reply
  35. Everyone loves what you guys tend to be up too. This kind
    of clever work and exposure! Keep up the good
    works guys I’ve included you guys to my blogroll.

    Reply
  36. Hi, i think that i saw you visited my blog thus i came
    to “return the favor”.I am trying to find things
    to improve my site!I suppose its ok to use a few of your ideas!!

    Reply
  37. This design is spectacular! You most certainly know how
    to keep a reader entertained. Between your wit and your videos,
    I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job.
    I really enjoyed what you had to say, and more than that, how you presented it.
    Too cool!

    Reply