I have this section of code for a todo list and when I press Enter I want to clear the text in the input field. Any idea how to do this?
document.addEventListener("keyup", function (event) {
if (event.key === 'Enter') {
var inputText = document.getElementById("the-input").value;
var node = document.createElement("li");
var textnode = document.createTextNode(`•${inputText}`);
node.appendChild(textnode);
document.getElementById("list").appendChild(node);
}
});