Skip to content

Commit e667ceb

Browse files
committed
実際のコードの写し
1 parent 88e6a86 commit e667ceb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/2-browser-apps/06-project/index.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@ todoList.appendChild(li);
7474

7575
```js
7676
addButton.onclick = () => {
77-
console.log(todoInput.value); // todoInput に入力された内容を console に表示する
77+
const todoItem = document.createElement("li"); // li 要素を作る
78+
const todoText = document.createElement("span"); // span 要素を作る
79+
todoText.textContent = todoInput.value; // span 要素の textContent を todoInput の value にする
7880
todoInput.value = ""; // todoInput の入力を空にする
81+
// 以下 Node#appendChild などを使い、整形する
7982
};
8083
```
8184

0 commit comments

Comments
 (0)