如何存储用户在网页中添加的新元素?

时间:2018-09-14 13:18:21

标签: javascript jquery html local-storage

我想将用户更改存储在我的网页中,以便用户可以转到下一页,然后返回该页面,以便他回来编辑该网页时应在其中添加所添加的元素。在他提交表单之前,我不希望将数据存储到数据库中。

让我解释一个例子

in this image user add a new item to list by entering the name in input field I want to store these new items so that user can go to next and can come back with the list item present

1 个答案:

答案 0 :(得分:-3)

您可以使用JavaScript设置要保留的所有更改的Cookie。如果用户稍后返回页面,请从Cookie恢复更改。