How do we store a string in localStorage?

后端 未结 4 1261
梦如初夏
梦如初夏 2021-01-13 19:14

I\'m learning javascript, xml, and html. For a homework assignment, I need to retrieve some data from some nodes of a XML file, concatenate the data, and store the concaten

4条回答
  •  无人及你
    2021-01-13 19:48

    I can't see anywhere in your code where you're storing something to localStorage. You're trying to retrieve localStorage[students], but there's nothing there.

    Note also that you can only store strings in localStorage. You're assigning a jQuery result to students at one point. Were you to try and store that in localStorage it would fail as it's an array of jQuery obects.

提交回复
热议问题