• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

전송 버튼

20.08.23 02:27 작성 조회수 83

0

안녕하세요 전송 버튼을 따로 만들고 싶어서 

 input style 아래에 저렇게 추가를 했는데,

e.target.value 값을 받아오는 방법을 알 수 있을까요 .. ㅜㅜ?

<input style={{
                    margin: 0, width: '79%', height: 50, border: '0px',
                    borderRadius: '2px', padding: '5px', fontSize: '1rem', backgroundColor: 'rgba(0,0,0,0.05)'
                }}
                    placeholder="메세지를 입력하세요 ..."
                    onKeyPress={keyPressHandler}
                    type="text" />
                
                <a href="#"
                    type="text"
                    style={{
                        margin:'0px 0px 0px 3px', border: '0px', borderRadius: '1px',
                        padding: '14px 18.1px 14px 18.7px', fontSize: '1rem', backgroundColor: 'rgba(0,0,0,0.05)'
                    }}
                    onClick={handleClick}
                    >
                        전송
                </a>

답변 1

답변을 작성해보세요.

0

input 에서 받아오시려는 건가요 ? 
const onKeyPress = (e) => {

console.log(e.target.value) 

이런식으로 해주시면 됩니다 ~ !