◾️ get input data without refresh
<form class="todo-form">
<input class="todo-form__input type="text">
</form>
const todoForm = document.querySelector(".todo-form");
const todoInput = document.querySelector(".todo-form__input");
function handleSubmit(e) {
e.preventDefault();
console.log(todoInput.value);
todoInput.value = "";
}
function init() {
todoForm.addEventListener("submit", handleSubmit);
}
init();