<title>Пример</title> <script type='text/javascript' src='jquery.js'></script> <style> textarea { background: yellow; } </style> <h3>Ваше Имя: </h3> <input type='text' id='exText' value='' /> <br> <h3>Текст сообщения:</h3> <textarea rows="6" cols="40" name="text" id='exText1' value='Текст'></textarea> <input type='button' onclick='insertText();' value=' Отправить ' /> <div id='testDiv' style='width:98%; padding:5px; border:1px solid black; background-color:lightyellow;'>Комментарии:</div> <script type="text/javascript"> <!-- function insertText() { testDiv = document.getElementById('testDiv'); testDiv.innerHTML = testDiv.innerHTML + '<br><br>' + '<font color=blue size=-1>Имя:</font>' + '<i>' + document.getElementById('exText').value + '</i>' + '<br>' + document.getElementById('exText1').value; } document.getElementById('exText').onkeydown = function(key) { if (key.keyCode == 13) { insertText(); } } -- > </script> 

When you enter the name and any text click send the entered text appears below, changed the text, clicked send another one appeared, and I need this text to not be deleted after the page reload.

How to do this?

  • So what? - Qwertiy
  • With this code I want to add a couple of lines when adding text, so that after the reboot they remain - titan-ser
  • Well, where do you use localStorage? - ArchDemon
  • so I ask you to help me save these lines after adding via localStorage - titan-ser

0