Skip to content

Commit 13cb02f

Browse files
committed
「プロジェクト」の節のToDoアプリの解答のタイポを修正
1 parent 574f70e commit 13cb02f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/2-browser-apps/06-project/_samples/todo/script.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ const todoList = document.getElementById("todo-list");
22
const todoInput = document.getElementById("todo-input");
33
const addButton = document.getElementById("add-button");
44

5-
todoInput.oninput = () => (addButton.disabled = todoInput === "");
5+
todoInput.oninput = () => {
6+
addButton.disabled = todoInput.value === "";
7+
};
68

79
addButton.onclick = () => {
810
const todoItem = document.createElement("li");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ addButton.onclick = () => {
271271
addButton.disabled = true; // valueへの代入はoninputイベントを発火しない
272272
editButton.textContent = "編集";
273273
editButton.onclick = () => {
274-
const input = prompt("新しい内容を入力してください");
274+
const input = prompt("新しい内容を入力してください");
275275
// prompt関数は入力された文字列が空の場合は空文字列 ("")、キャンセルされた場合はnullを返す
276276
if (input !== "" && input !== null) todoText.textContent = input;
277277
};

0 commit comments

Comments
 (0)