File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
docs/2-browser-apps/06-project Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ const todoList = document.getElementById("todo-list");
22const todoInput = document . getElementById ( "todo-input" ) ;
33const addButton = document . getElementById ( "add-button" ) ;
44
5- todoInput . oninput = ( ) => ( addButton . disabled = todoInput === "" ) ;
5+ todoInput . oninput = ( ) => {
6+ addButton . disabled = todoInput . value === "" ;
7+ } ;
68
79addButton . onclick = ( ) => {
810 const todoItem = document . createElement ( "li" ) ;
Original file line number Diff line number Diff 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 };
You can’t perform that action at this time.
0 commit comments