jquery - press Enter in td then pressing tab key -
<div id="unidataint"> <table class="table table-bordered" id="uniresult"> <td contenteditable="true" onfocus="showedit(this);" class="highlight-border">hello</td> <td contenteditable="true" onfocus="showedit(this);" class="highlight-border">hello1</td> <td contenteditable="true" onfocus="showedit(this);" class="highlight-border">hello</td> </table> </div>
this jquery code:
$('#unidataint').on('keyup', 'td', function() { if (e.keycode == 13) return e.keycode = 9; });
try following
$(document).ready(function(){ $('#unidataint').on('keydown', 'td', function(e) { if (e.keycode == 13){ e.preventdefault(); $(this).next().focus(); } }); });
Comments
Post a Comment