Merged
Conversation
This was
linked to
issues
Mar 20, 2026
kcleverp
reviewed
Mar 20, 2026
kcleverp
reviewed
Mar 20, 2026
kcleverp
reviewed
Mar 20, 2026
aeongiing
reviewed
Mar 21, 2026
qkrdmsthff
reviewed
Mar 21, 2026
OscarKang1
reviewed
Mar 22, 2026
Comment on lines
+1
to
+47
| console.log("JS 연결") | ||
| // 글자 입력창 | ||
| const input = document.getElementById('todo-input'); | ||
| // 해야 할 일 | ||
| const todoList = document.getElementById('todo-list'); | ||
| // 해낸 일 | ||
| const doneList = document.getElementById('done-list'); | ||
|
|
||
| input.addEventListener('keydown', (event) => { | ||
| if (event.isComposing) return; | ||
| // space만하고 enter 방지 .trim | ||
| if (event.key === 'Enter' && input.value.trim() !== "") { | ||
| console.log("enter 확인, 입력값:", input.value) | ||
| addTodo(input.value); | ||
| input.value = "" | ||
| } | ||
| }); | ||
|
|
||
| function addTodo(text) { | ||
| const li = document.createElement('li'); | ||
|
|
||
| const span = document.createElement('span'); | ||
| span.innerText = text; | ||
|
|
||
| const button = document.createElement('button'); | ||
| button.innerText = "완료"; | ||
| button.className = "complete-btn"; | ||
|
|
||
| button.onclick = function() { | ||
| completeTodo(li); | ||
| }; | ||
|
|
||
| li.appendChild(span); | ||
| li.appendChild(button); | ||
| todoList.appendChild(li); | ||
| } | ||
|
|
||
| function completeTodo(li) { | ||
| const btn = li.querySelector('.complete-btn'); | ||
| if (btn) { | ||
| btn.innerText = "삭제"; | ||
| btn.onclick = function() { | ||
| li.remove(); | ||
| }; | ||
| doneList.appendChild(li); | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
전체적으로 기능 흐름을 깔끔하게 잘 구현하신 것 같습니다 .
제 코드에서는 localStorage를 활용하여 상태를 저장하고, 새로고침 이후에도 데이터가 유지되도록 구성했습니다. 이런 방식으로 상태를 관리하면 사용자 경험을 개선할 수 있을 것 같습니다.
좋은 코드 잘 봤습니다!
qkrdmsthff
approved these changes
Mar 23, 2026
Collaborator
qkrdmsthff
left a comment
There was a problem hiding this comment.
LGTM 동동 ~~
코드리뷰, 학습회고, 트러블슈팅 정말 잘 써주셨네요!!
수고 많으셨고 merge 해 주시면 됩니다!!
2주차도 화이팅!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✅ 워크북 체크리스트
✅ 컨벤션 체크리스트
📌 주안점