Open
Conversation
Author
yujo11
requested changes
Nov 12, 2023
Owner
yujo11
left a comment
There was a problem hiding this comment.
안녕하세요 용준님~
간단한 코멘트 몇개 남겼는데 확인 부탁드립니다 ㅎㅎ
고생 많으셨어요~!
Comment on lines
+16
to
+19
| <form> | ||
| <input type="text" id="user-input" /> | ||
| <button id="submit">확인</button> | ||
| </form> |
| resultEl.textContent = result; | ||
| }; | ||
|
|
||
| submitBtnEl.addEventListener("click", handleSubmit); |
Owner
There was a problem hiding this comment.
form을 사용하도록 변경해서 여기도 submit 이벤트를 활용해보시면 좋을거 같네요!
| }; | ||
|
|
||
| const handleSubmit = (e) => { | ||
| const userInputNumbers = Number(userInputEl?.value); |
Owner
There was a problem hiding this comment.
submit event를 사용하면 다시 DOM에 접근해서 값을 가져오는게 아니라 전달 받은 Event 객체에서 값을 가져올 수 있을거 같네요 ㅎㅎ
|
|
||
| const handleSubmit = (e) => { | ||
| const userInputNumbers = Number(userInputEl?.value); | ||
| const result = baseballGame.play(computerInputNumbers, userInputNumbers); |
Owner
There was a problem hiding this comment.
result를 텍스트로 받아오고 있는데요. result에서 ball과 strike 개수를 받아서 처리해도 좋을거 같네요
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.
Uh oh!
There was an error while loading. Please reload this page.