0
this과 비슷한 질문이 있지만 "Enter"키를 누를 때 브라우저가 양식을 제출하는 것을 원하지 않습니다. 대신에, 나는 다음과 같은 형태를 갖는다 :양식에서 Enter 키를 누를 때 페이지에 머물러있는 방법 찾기
<form id="google_inputs">
<h1 class="theme-text">Find a Store</h1>
<input type="text" id="origin-address" value=""><br>
<input type="button" label="test" value="search stores" onclick="onGoogleDistanceSearch()"/>
<input type="button" label="test" value="search stores using my location" onclick="onGoogleDistanceSearchWithCurrentLocation()"/>
<form/>
나는 버튼을 누를 때 HTML 렌더링 자바 스크립트를 가지고, 내가 페이지 새로 고침을 야기하고 싶지 않아요. 내 주위에 구글 봤는데 비슷한 게시물을 보았지만 아무것도이 문제를 해결하는 것. 내가 말했듯이
<input type"executeJavaScriptDoNotRefreshPage()"/>
, 내가 W3 page on inputs and didn't find anything 바라 보았다 : 입력 태그 같은 것을 할 무언가를 취할 수있는 속성이있다.
'# origin-address'의 keydowns를 듣고 'Enter'(키 코드 13)를 누르면 기본 동작을 방지합니다. – Teemu