Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- document.getElementById("addItem").onclick = () => {
- var todoInput = document.getElementById("todo-input");
- var itemList = document.getElementById("item-list");
- var newItem = document.createElement('li');
- var doneButton = document.createElement('button');
- newItem.textContent = todoInput.value;
- itemList.appendChild(newItem);
- doneButton.className = "done";
- doneButton.onclick = () => {
- this.parentNode.remove();
- };
- doneButton.textContent = "Done";
- newItem.appendChild(doneButton);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement