When I click the "Add" button, I expect the new task to appear in the list, but nothing happens.
Here's my code:
function addTodo() {
const input = document.getElementById("todo-input");
const list = document.getElementById("todo-list");
const item = document.createElement("li");
item.textContent = input.value;
list.appendChild(item);
}< /code>
Add
< /div>
< /div>
< /p>
Я не вижу никаких ошибок в консоли, но список остается пустым.
Что я делаю неправильно? < /p>
Подробнее здесь: https://stackoverflow.com/questions/796 ... o-the-list
Мобильная версия