【发布时间】:2021-07-06 19:16:38
【问题描述】:
我在 test0.html 文件中有这个简单的代码,它将数据发送到 test1.html:
<body>
<form action="test1.html">
<input type="text" name="array[0]" placeholder="val1" id="">
<input type="text" name="array[1]" placeholder="val2" id="">
<input type="submit" value="send">
</form>
</body>
然后我在 test1.html 上有这段代码,它应该将一些新数据发送回 test0:
<body>
<form action="test0.html">
<input type="text" name="array[2]" placeholder="val3" id="">
<input type="text" name="array[3]" placeholder="val4" id="">
<input type="submit" value="send back">
</form>
当我将数据发送回 test0 时,我只是获得了在 test1.html 中键入的最新数据。我想知道如何跟踪以前从 test0 发送的那些。
谢谢!
【问题讨论】:
-
您可以使用
localStorage来跟踪数据 -
好吧,这更有意义...
标签: javascript html arrays forms