Todo List One

Extend the JavaScript code below to interact with the displayed HTML elements.
Enter a new todo in the input field. Once you click the button, the new todo item should appear at the bottom of the list.
Confirm your code by creating a new todo!
  • Read a book
  • Lunch with Caro
  • Feed the dog
View
<input id="input" placeholder="To do..."/>
<button type="button" id="button">Add</button>
<ul id="list">
<li>Read a book</li>
<li>Lunch with Caro</li>
<li>Feed the dog</li>
</ul>
HTML
const button = document.getElementById('button'); button.addEventListener('click' , () => { // type in your code here

});
Javascript