   const handleFormSubmit = event => {
        event.preventDefault();

        const task = $newTodoInput.value.trim();

        if (!task.length) return;

        const $todo = createTodo(task);
        $todos.appendChild($todo);

        $newTodoInput.value = '';
      };

      $addTodoForm.addEventListener('submit', handleFormSubmit);
    })();
  </script>
</body>

</html>