Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const inputField = document.getElementById("input_field");
- const addButton = document.getElementById("button");
- const toDoList = document.getElementById("todolist");
- addButton.addEventListener("click", () => {
- const inputValue = inputField.value;
- const newListItem = document.createElement("li");
- const checkBox = document.createElement("input");
- checkBox.type = "checkbox";
- const label = document.createElement("label");
- label.textContent = inputValue;
- newListItem.appendChild(checkBox);
- newListItem.appendChild(label);
- toDoList.appendChild(newListItem);
- inputField.value = '';
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement