자바스크립트 키 이벤트
-
[instagram 클론코딩] input 창에 엔터치거나 "게시"누르면 댓글 추가 구현하기프론트엔드 개발자가 될거야./js 2022. 6. 29. 08:47
엔터치거나 "게시"누르면 댓글 추가 짠~~ 나만의 인스타그램을 만들었다. 레이아웃에 대해서도 할 말이 많지만 일단 이 게시물에는 JS로 구현한 사항에 대한 것만 작성해보려고 한다. 구현해야 할 사항은 댓글 input 창에 엔터치거나 "게시" 누르면 댓글 추가되도록 createElement로 요소 생성해서, input에 입력한 값이 추가 되어야합니다. 나의 코드 const input = document.querySelector('.input__comment'); const submit = document.querySelector('.input__submit'); const parentComment = document.querySelector('.contents__comments'); function isE..