I do a
localStorage.setItem('oldData', $i("textbox").value);
to set the value of key oldData
to the value in a textbox.
The next time something is entered to the textbox, I want to append to the already existing oldData
.
So, if I enter apples and then oranges in my textbox, my localStorage key oldData
should look like this:
Initially:
Key | Value
---------------------------
oldData | apples
Now:
oldData | apples oranges
How can I append? Is there an append
method provided?
Or do I need to read the data first, append in javascript and then write back?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…