Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<textarea style="width:200px; height: 60px;" id="area" placeholder="Write here"></textarea>
<textarea style="width:200px; height: 60px;" id="area" placeholder="Напишите сообщение здесь"></textarea>
<br>
<button onclick="localStorage.removeItem('area');area.value=''">Clear</button>
<button onclick="localStorage.removeItem('area');area.value=''">Очистить</button>
<script>
area.value = localStorage.getItem('area');
area.oninput = () => {
Expand Down
8 changes: 4 additions & 4 deletions 6-data-storage/02-localstorage/1-form-autosave/task.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

# Autosave a form field
# Автосохранение поля формы

Create a `textarea` field that "autosaves" its value on every change.
Создайте поле `textarea`, значение которого будет автоматически сохраняться при каждом его изменении.

So, if the user occasionally closes the page, and opens it again, he'll find his unfinished input at place.
Когда пользователь закроет страницу и потом откроет ее заново он должен увидеть последнее введенное значение.

Like this:
Вот пример:

[iframe src="solution" height=120]
Loading