title: Selecting next field on press enter using jquery
body: <p>I have a html form and whenever <code>enter</code> is pressed the next field is selected.<br>
  here is a code.  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> $(document).on("keydown","input",function(event) {
       if (event.which === 13) {
        event.stopPropagation();
        event.preventDefault();
        $(this).nextAll("input").eq(0).focus();
       }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;form&gt;
       &lt;table&gt;
        &lt;tr&gt;
         &lt;td&gt;Medical Record No.&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="labNo" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
         &lt;td&gt;Age/sex &lt;/td&gt;&lt;td&gt;&lt;input type="text" name="age" /&gt;
          &lt;select id="age"&gt;
           &lt;option value="Year"&gt;Year&lt;/option&gt;
           &lt;option value="Month"&gt;Month&lt;/option&gt;
          &lt;/select&gt;
          &lt;select id="sex"&gt;
           &lt;option value="Male"&gt;Male&lt;/option&gt;
           &lt;option value="Female"&gt;Female&lt;/option&gt;
          &lt;/select&gt;
         &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
         &lt;td&gt;Phone &lt;/td&gt;
         &lt;td&gt;&lt;input type="text" name="" value="-,-" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
         &lt;td colspan="2"&gt;&lt;input type="button" id="patBtn" value="Save (S)" accesskey="s" /&gt;
          &lt;input type="reset" value="Set Default (D)" accesskey="d" /&gt;
         &lt;/td&gt;
        &lt;/tr&gt;
       &lt;/table&gt; 
      &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is not working.</p>