在jquery中获取tab按事件 [英] Get tab press event in jquery
问题描述
我正在使用 jsgrid ,我需要通过键盘按下或上/下箭头按键事件(当jsgrid处于可编辑模式时)在jquery中。
我尝试过:
< script>
$(输入).keydown(函数(e){
调试器;
if (e.which === 9)
alert(Hurray !!!);
});
< / script> ;
以上代码片段无效。我认为这是因为jquery / css使网格行可编辑但上面的代码片段无法找到输入。
标签按的实例是http://jsfiddle.net/QfCpC/1/
(输入).keydown(函数(e){
调试器;
if(e.which === 9)
alert( Hurray !!!);
});
< / script>
以上代码片段不起作用。我认为这是因为jquery / css使网格行可编辑但上面的代码片段无法找到输入。
标签按下的实例是http://jsfiddle.net/QfCpC/1/
< script < span class =code-attribute> type = text / javascript >
document.onkeyup = PresTab;
函数PresTab(e)
{
var keycode =(window。事件)? event .keyCode:e.keyCode;
if (keycode == 9 )
alert(' 按Tab键);
}
< / script > 跨度>
I am using jsgrid and i need tab press or up/down arrow key press event from keyboard (when jsgrid is in editable mode) in jquery.
What I have tried:
<script>
$("input").keydown(function (e) {
debugger;
if (e.which === 9)
alert("Hurray!!!");
});
</script>
above code snippet is not working.I think this happens due to jquery/css make grid row editable but above code snippet is unable to find input.
live example of tab press is http://jsfiddle.net/QfCpC/1/
("input").keydown(function (e) {
debugger;
if (e.which === 9)
alert("Hurray!!!");
});
</script>
above code snippet is not working.I think this happens due to jquery/css make grid row editable but above code snippet is unable to find input.
live example of tab press is http://jsfiddle.net/QfCpC/1/
<script type="text/javascript"> document.onkeyup = PresTab; function PresTab(e) { var keycode = (window.event) ? event.keyCode : e.keyCode; if (keycode == 9) alert('tab key pressed'); } </script>
这篇关于在jquery中获取tab按事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!