テキストボックスにフォーカスがある時にエンターキーでイベントを起動
html側
<input type="text" onkeypress="hoge(event.keyCode);" />
function hoge(code) { //エンターキー押下なら if(13 === code) { alert("エンターキーが押されたよ!"); } }
html側
<input type="text" onkeypress="hoge(event.keyCode);" />
function hoge(code) { //エンターキー押下なら if(13 === code) { alert("エンターキーが押されたよ!"); } }