const changeHandler = (e) => {
e.target.getAttribute('type') == "number"
? setTimeout(()=>{
setAlert(false)
},2000)
: console.log('not a number')
}
<input type="number" onChange={changeHandler} />
이런식으로 구현을 하긴했는데 input에서 type을 숫자만 쓸수있으니 텍스트를썼을때 alert를 어떻게 줘야 되는지 모르겠더라구요 ㅠㅠ
input에서 들어온 값이 숫자인지 텍스트인지 확인하는 방법만 알려주시면 감사하겠습니다 ㅠㅠ