请我继续收到此错误无法设置属性'display'的未定义//在HTMLListElement.filter Todo /在NodeList.forEach)/

**

  1. script.js:153未捕获的TypeError:无法设置属性“显示”
  2. 未定义
  3. 在script.js:153
  4. 在NodeList.forEach()
  5. 在HTMLSelectElement.filterTodo(script.js:150)

**

请我继续收到此错误
enter code here function filterTodo(e) {
let todos = todoList.childNodes;
todos.forEach(function(todo) {
  switch (e.target.value) {
    case "all":
      todo.style.display = "flex";
      break;
    case "completed":
      if (todo.classList.contains("completed")) {
        todo.style.display = "flex";
      } else {
        todo.style.display = "none";
      }
      break;
    case "uncompleted":
      if (!todo.classList.contains("completed")) {
        todo.style.display = "flex";
      } else {
        todo.style.display = "none";
      }
  }
});

}

评论