【发布时间】:2020-11-05 14:17:56
【问题描述】:
我需要在 html 中获取输入并在 localStorage 中保存为数组或类似这样的 json:
[{"id":"item-1","icon":"google.com"},{"id":"item-2","icon":"youtube.com"}]
【问题讨论】:
-
欢迎来到 Stack Overflow!寻求代码帮助的问题必须包括在问题本身中重现它所需的最短代码,最好是在Stack Snippet 中。请参阅如何创建 Minimal, Reproducible Example。在您的问题中显示预期结果并引用您遇到的任何(确切)错误也非常有帮助。您应该展示自己为解决这个问题所做的任何研究。
-
这能回答你的问题吗? Updating localstorage arrays in Javascript
标签: html arrays local-storage