File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
docs/2-browser-apps/06-project Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,9 @@ const todoList = document.getElementById("todo-list");
269269const todoInput = document .getElementById (" todo-input" );
270270const addButton = document .getElementById (" add-button" );
271271
272- todoInput .oninput = () => (addButton .disabled = todoInput === " " );
272+ todoInput .oninput = () => {
273+ addButton .disabled = todoInput .value === " " ;
274+ };
273275
274276addButton .onclick = () => {
275277 const todoItem = document .createElement (" li" );
@@ -281,7 +283,7 @@ addButton.onclick = () => {
281283 editButton .textContent = " 編集" ;
282284 editButton .onclick = () => {
283285 const input = prompt (" 編集内容を入力してください" );
284- // prompt が空で入力された場合は空文字列 ("")、キャンセルされた場合は null を返す
286+ // prompt で入力された文字列が空の場合は空文字列 ("")、キャンセルされた場合は null を返す
285287 if (input !== " " && input !== null ) todoText .textContent = input;
286288 };
287289 deleteButton .textContent = " 削除" ;
You can’t perform that action at this time.
0 commit comments