Showing 1 changed files with 8 additions and 1 deletions
+8 -1
templates/index.html.ep
... ...
@@ -147,6 +147,13 @@
147 147
       
148 148
       return false;
149 149
     });
150
+    
151
+    // Enterで検索
152
+    $('[name=word]').bind('keypress', function (e) {
153
+      if (e.keyCode === 13) {
154
+        $('#search').trigger('click');
155
+      }
156
+    });
150 157
   });
151 158
 % end
152 159
 
... ...
@@ -158,7 +165,7 @@
158 165
 
159 166
   <div id="boxB">
160 167
       <div style="margin-bottom:5px">
161
-        <%= text_field 'word' , style => "width:160px" %>
168
+        <input type="text" name="word", style = "width:160px">
162 169
         <button id="search" style="width:50px;padding:2px;">検索</button>
163 170
       </div>
164 171
       <div style="margin-bottom:10px;">