작성
·
135
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)
}
이런식으로 해주시면 됩니다 ~ !