html <input> 태그 내에서 enter 를 입력 시 javascript로 원하는 이벤트를 발생시키는 방법

input 태그 내에

<input type="text" 
	onkeypress="if(window.event.keyCode==13){ function name() }"
    />

를 작성해주도록 한다.

 

enter = keyCode 13

반응형

+ Recent posts