HTML5 localStorage replace data to already existing key

Viewed 30710

I have the following localStorage key:

localStorage.setItem(1, "<div id='MyId'>value 1</div><div id='NewId'>other value</div>");

Is it possible to replace, change only the second id, make the:

<div id='MyId'>value 1</div><div id='NewId'>other value</div>

turn into

<div id='MyId'>value 1</div><div id='NewId'>replaced value</div>

I do not want to delete this key and create a new one, just replace a part of it. Thank you.

1 Answers
Related