添加新的待办事项清单

时间:2020-05-21 05:55:49

标签: javascript

目标是在单击“ NEW TODO”按钮时创建一个新的待办事项列表,以下是我的入门脚本,有人可以帮我吗?

const classNames = {
  TODO_ITEM: 'todo-container',
  TODO_CHECKBOX: 'todo-checkbox',
  TODO_TEXT: 'todo-text',
  TODO_DELETE: 'todo-delete',
}

const list = document.getElementById('todo-list')
const itemCountSpan = document.getElementById('item-count')
const uncheckedCountSpan = document.getElementById('unchecked-count')
<div class="container center">
  <h1 class="center title">My TODO App</h1>
  <div class="flow-right controls">
    <span>Item count: <span id="item-count">0</span></span>
    <span>Unchecked count: <span id="unchecked-count">0</span></span>

  </div>
  <button class="button center" onClick="newTodo()">New TODO</button>
  <ul id="todo-list" class="todo-list"></ul>
</div>

1 个答案:

答案 0 :(得分:0)

  1. 创建该功能DriveApp.getFolderById("1rsicZccurujGp5Ye5HUecBIAPf3_h5Pc");
  2. newTodo()内,通过其ID(newTodo和其内的append <ul>获得该todo-list元素。

我不确定您为什么将此类名称存储在数组中